Thanks Paul.  Linking the column's datafield to a VirtualField did the
trick.  Brilliant.

> I have a form with a pageframe. The detail page has a maskedTextBox to
> display and edit a phone number and is constructed this way:
> dabo.ui.dMaskedTextBox(self,Width=100,DataSource =
> "address",DataField="HomePhone",Mask="###-###-####"). This displays as
> expected, i.e., 555-222-1111. Data saved to the table from the
maskedTextBox
> is saved without the dashes. On the first page I have a grid displaying
> records from the same table. One column is linked to the phone number but
> displays the phone number without the dashes, i.e., 5552221111. Is there a
> way to format this column so it appears as phone number with the dashes?
Or
> should I be approaching this thing another way?
>
> Any help appreciated.

Until we get a masked grid renderer, you can set up a VirtualField in
your bizobj to force it. IOW something like:

class MyBiz(dabo.biz.dBizobj):
  self.VirtualFields["masked_phone_num"] = self.getMaskedPhone

  def getMaskedPhone(self):
  phone = self.Record.phone
  return "%s-%s-%s" % (phone[0:3], phone[3:6], phone[6:10])

And then make the DataField of that column "masked_phone_num".

Paul


--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]

Reply via email to