On Friday 02 March 2007 13:42, Antonio Dias wrote:
> Ed, I think you didn't undersand...
>
> in formA I have a grid and a button.
> clicking on the button I want to show the formB
>
> I created the callb() function under formA
> ==
> def callb(self):
>    formB = createForm("formB.cdxml")  =or=>  self.formB = ... it dont work
>    formB.show() =or=> self.formB.show()
> ==
>
> on the event of the button in formA, the following codes don't work
> ==
> def onHit(self, evt):
>    formA.callb()  <-- dont work - error: global variable formA not defined
> or
>     self.formA.callb() <--dont work - error: button has no attribute formA
>
> what I did wrong??
>
> Tony

Tony, I and others have pointed out using "self.Form.callb"  Note: "Form" 
not "form".  So have you tried that?  Also you might want to use a few print 
statements in case the real cause of the failure is the cdxml form file.

so:
def onHit(self,evt):
  self.Form.callb()
# the above is calling the form method "callb()"
# you could also call it 
# self.parent.callb() because the parent of the button.onHit() is the form = 
self.Form.

def callb(self):
  print "Hello world"
  
-- 
John Fabiani

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Reply via email to