com.wewebu.ow.server.app
Class OwEditablePropertyString

java.lang.Object
  extended by com.wewebu.ow.server.app.OwEditablePropertyString
All Implemented Interfaces:
OwEditableProperty
Direct Known Subclasses:
OwEditablePropertyDate

public class OwEditablePropertyString
extends Object
implements OwEditableProperty

Base class for a single editable property used in HTML forms.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com


Field Summary
protected  String m_strError
          a error message for this field, if update failed
protected  Object m_value
          current value of property
 
Constructor Summary
OwEditablePropertyString()
           
 
Method Summary
protected  String getFormElementID()
          get a unique ID for the HTML form element
 String getSafePropertyError(Locale locale_p)
          gets a error message for this field, if update failed, clears the message automatically
 Object getValue()
          get current value of property
protected  Object getValueFromRequest(Locale locale_p, javax.servlet.http.HttpServletRequest request_p, String strID_p)
          overridable to apply changes on a submitted form
 void render(Writer w_p, int iCols_p, int iRows_p)
          insert the property into a HTML form for editing
 void setValue(Object value_p)
          set current value of property, to be overridden
 boolean update(Locale locale_p, javax.servlet.http.HttpServletRequest request_p)
          apply changes form a HTML form request, to be overridden
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_value

protected Object m_value
current value of property


m_strError

protected String m_strError
a error message for this field, if update failed

Constructor Detail

OwEditablePropertyString

public OwEditablePropertyString()
Method Detail

getValue

public Object getValue()
get current value of property

Specified by:
getValue in interface OwEditableProperty
Returns:
Object if isList() is true, Object is a list

setValue

public void setValue(Object value_p)
set current value of property, to be overridden

Specified by:
setValue in interface OwEditableProperty
Parameters:
value_p - Object

update

public boolean update(Locale locale_p,
                      javax.servlet.http.HttpServletRequest request_p)
               throws Exception
apply changes form a HTML form request, to be overridden

Specified by:
update in interface OwEditableProperty
Parameters:
request_p - HttpServletRequest with form data to update the property
locale_p - Locale to use
Returns:
true = value changed, false = value did not change
Throws:
Exception

getValueFromRequest

protected Object getValueFromRequest(Locale locale_p,
                                     javax.servlet.http.HttpServletRequest request_p,
                                     String strID_p)
                              throws Exception
overridable to apply changes on a submitted form

Parameters:
request_p - HttpServletRequest with form data to update the property
strID_p - String the HTML form element ID of the requested value
Throws:
Exception

getSafePropertyError

public String getSafePropertyError(Locale locale_p)
gets a error message for this field, if update failed, clears the message automatically

Specified by:
getSafePropertyError in interface OwEditableProperty
Returns:
String error message or an empty string

getFormElementID

protected String getFormElementID()
get a unique ID for the HTML form element


render

public void render(Writer w_p,
                   int iCols_p,
                   int iRows_p)
            throws Exception
insert the property into a HTML form for editing

Parameters:
w_p - Writer to write HTML code to
iCols_p - int number of columns of 0 to use a single input field
iRows_p - int number of rows of 0 to use a single input field
Throws:
Exception


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.