[Zope3-Users] multi-field text widget

Christophe Combelles ccomb at free.fr
Wed May 2 14:01:06 EDT 2007


Aaron Cripps a écrit :
> I need a custom widget that I can use to display/get an IP for a 
> "Computer object" that I've written. I've tried looking at 
> zope.schema.TextLine as a starting point to making a widget that can
> store each octet of the IP address separately, but to no avail. The 
> #zope channel on irc.freenode.net isn't very helpful since most of those 
> folks are zope2 users. I was wondering if anyone could give me a hint on 
> where to start looking.
> Thanks,
> -Aaron Cripps

I would do the following:
- just use a TextLine schema field for the ip
- add a custom schema constraint that checks the dots and values of the ip address
- use the default textline widget associated with the TextLine schema field
- optionaly add a bit of javascript that helps the user entering a correct value
- add some method that can access individual octets of the ip if necessary

that seems simpler to me than implementing a multi-field text widget

Christophe


More information about the Zope3-users mailing list