@@ -257,60 +257,5 @@ class RenderTagLib implements com.opensymphony.module.sitemesh.RequestConstants
257257
258258 t. make(). writeTo(out)
259259 }
260- }
261-
262- /**
263- * Attempts to render input for a property value based by attempting to choose a rendering component
264- * to use based on the property type
265- */
266- def renderInput = { attrs , body ->
267- def bean = attrs[' bean' ]
268- if (! bean) {
269- throwTagError(" Tag [renderInput] is missing required attribute [bean]" )
270- }
271- if (! attrs[' property' ]) {
272- throwTagError(" Tag [renderInput] is missing required attribute [property]" )
273- }
274-
275- def app = grailsAttributes. getGrailsApplication()
276- def dc = app. getGrailsDomainClass(bean. class. name)
277- def pv = bean. metaPropertyValues. find {
278- it. name == attrs[' property' ]
279- }
280- if (! pv) {
281- throwTagError(" Property [${ attrs['property']} ] does not exist in tag [renderInput] for bean [${ bean} ]" )
282- }
283- def engine = grailsAttributes. getPagesTemplateEngine()
284- def uri = findUriForType(pv. type)
285-
286- if (! uri)
287- throwTagError(" Type [${ pv.type} ] is unsupported by tag [renderInput]. No template found." )
288-
289- def t = engine. createTemplate( uri,
290- servletContext,
291- request,
292- response)
293- if (! t) {
294- throwTagError(" Type [${ pv.type} ] is unsupported by tag [renderInput]. No template found." )
295- }
296-
297- def binding = [ name :pv. name,value :pv. value]
298- binding[' constraints' ] = (dc ? dc. constrainedProperties : null )
299-
300- t. make(binding). writeTo(out)
301- }
302-
303- private String findUriForType (type ) {
304- if (type == Object . class)
305- return null ;
306- def uri = " /WEB-INF/internal/render/${ type.name} .gsp" ;
307- def url = servletContext. getResource(uri)
308-
309- if (url != null ) {
310- return uri
311- }
312- else {
313- return findUriForType(type. superClass)
314- }
315- }
260+ }
316261}
0 commit comments