Skip to Content
0
Former Member
Sep 17, 2007 at 09:17 AM

Problme with custom property renderer

11 Views

Hi,

I have implemented a custom property renderer to render a property in a special way. (I want to display the beginning of a property in a new property A and the ending in a new property B)

So I build the following code:

public class CustomPropRendererYear implements IModelledPropertyRenderer{
	
	public IProperty iproperty = null;
     
    
	public Component renderProperty(IProperty property, IMetaName metaName, IResource resource, IProxy proxy, IParameters parameters) throws WcmException {
		
			
			TextView desc = new TextView("Hello World!");
			
			return desc;
			}
		}

When I use this renderer it works an there will be displayed "Hello World!" for every resource. But when I add some code I will not work, for example:

public Component renderProperty(IProperty property, IMetaName metaName, IResource resource, IProxy proxy, IParameters parameters) throws WcmException {
		
			String prop = property.getValueAsString();
			TextView desc = new TextView("Hello World!");
			
			return desc;
			}

With this code there will be no renderer property. When I delete the 'String prop' it will work and "Hello World!" is displayed again.

I hope someone can help me.

Best regards

Christian