def mainClass = Class.forName(domainName)
def mClass = Class.forName(matchClass)
DefaultGrailsDomainClass domainClass = new DefaultGrailsDomainClass (mainClass)
DefaultGrailsDomainClass domainMatch = new DefaultGrailsDomainClass (mClass)
class ItemCustoIniciativaDispService {
static def pHelpFiles = [:]; static Boolean doRemotePaginate = true
static Boolean hasTreeViewPresentation = false
static String columnLink = "descricao"
/**
* Created by PedroGentil on 03/12/2015.
*/
class TbcDomainService {
...
def static String getColumnLink (DefaultGrailsDomainClass domainClass) {
String lsRet = ""
String lsClassName = domainClass.getFullName() + "DispService"
def classDisp = Class.forName(lsClassName)
lsRet = classDisp."${'columnLink'}"
return lsRet
} // renderSearchingFields
for (p in props) {
if (p.manyToMany) {
...
In oter site:it << ' <g:form>\n'
/* Campos do Formulário */
it << '<!-- <legend>Form</legend> -->\n'
colunLink = trustBC.TbcDomainService.getColumnLink(p?.getReferencedDomainClass())
it << ' <div class="span6 default-color3">\n'
it << ' <div class="control-group">\n'
it << ' <label class="control-label"> '
it << ' <g:message code="' << colunLink.toString() << '.label" default="Buscar" locale="\${session.getAttribute(\'locale\')}"/>\n'
it << '</label><br/>\n'...
for (p in props) {
if (p.isEmbedded()) {
def embeddedPropNames = pSearchingMap.get(p.getName())
def embeddedProps = p.component.properties.findAll { embeddedPropNames}
lsRet << renderEnbeddedProps (embeddedProps, domainClass) << "\n"
...
--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/6A9F8521-5F0D-495E-96E3-64750C1D1029%40objectcomputing.com.
It still is not clear why you need to create an instance of DefaultGrailsDomainClass yourself. This whole thing could be done without referencing any of that but assuming there is some reason you want to use DefaultGrailsDomainClass you can retrieve the instance that the framework has already created for you by calling grailsApplication.getDomainClass(ItemCustoIniciativa.name).
However, it looks like the only reason you want the DefaultGrailsDomainClass is you want to ask it for the domain class’ name, which you can just get from the domain class.
I hope some of that helps.
JSB
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/CAMD44zLas%3DAoceHu6QkLVcdbOcKpvMUqNJrnH8F5VPrr0PriFA%40mail.gmail.com.
colunLink = trustBC.TbcDomainService.getColumnLink(p?.getReferencedDomainClass())
it << ' <div class="span6 default-color3">\n'
it << ' <div class="control-group">\n'
it << ' <label class="control-label"> '
it << ' <g:message code="' << colunLink.toString() << '.label" default="Buscar" locale="\${session.getAttribute(\'locale\')}"/>\n'
it << '</label><br/>\n'...
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/586E976A-1534-4C48-9403-45E2778B30C6%40objectcomputing.com.