Index: /main/waeup.sirp/trunk/src/waeup/sirp/widgets/phonewidget.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/widgets/phonewidget.py	(revision 7351)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/widgets/phonewidget.py	(revision 7352)
@@ -16,4 +16,17 @@
 zope.formlib or newer form libs). Therefore some modifications were
 neccessary and it might look a bit overloaded.
+
+If you use the PhoneWidget for rendering regular TextLine attributes
+(preferably in edit forms or add forms), the phone number is displayed
+by three input fields representing the international code, the area
+code and the extension line. All three fields require pure numbers as
+input and do not accept other chars.
+
+When the entered input is stored with a context object, it is stored
+as a single unicode string with the numbers divided by single hyphen.
+
+So, input <12>, <111>, <444> becomes the string ``'12-111-444'`` for
+the context object.
+
 """
 import re
@@ -62,19 +75,31 @@
 
     def __init__(self, context, number=None):
+        """Set countrycode, areacode, and extension line from number.
+        """
         self.context = context
-        if number is not None:
-            # XXX: We have to provide something more tolerant
-            self.country, self.area, self.extension = number.split('-')
+        if number is None:
             return
-            try:
-                self.country, self.area, self.extension = number.split('-')
-            except ValueError:
-                replacement = '1-1-%s' % (number.replace('-', ''),)
-                self.country, self.area, self.extension = replacement.split(
-                    '-', 2)
+        # handle other types than strings.
+        if not isinstance(number, basestring):
+            number = str(number)
+        parts = number.split('-', 2)
+        if len(parts) == 2:
+            parts = [None,] + parts
+        elif len(parts) == 0:
+            return
+        elif len(parts) == 1:
+            parts = [None, None] + parts
+        self.country, self.area, self.extension = parts
+        return
 
     @property
     def number(self):
-        return u'-'.join((self.country, self.area, self.extension))
+        """Return a valid phone number string of format ``<IC>-<AC>-<EL>``.
+
+        where <IC> is the country code (digits only), <AC> is the area
+        code and <EL> is the extension line.
+        """
+        return u'-'.join(
+            (self.country or '', self.area or '', self.extension))
 
 
