In a message dated 8/10/2009 1:38:20 A.M. Eastern Daylight Time,
[email protected] writes:
> Because 'createForm' creates an instance of the form. You're treating
> it as though it returns a class, not an instance.
Got it.
> That's odd - I've used lots of these dialogs, and have never seen
> that behavior. Do you have any extra code in the OK button of the
> dialog? Or anything else you can think of that could possibly
> interfere with the button's action?
No code in OK button -- here's the full cdxml for the OK dialog
(findRun3.cdxml):
<?xml version="1.0" encoding="cp1252" standalone="no"?>
<dOkCancelDialog code-ID="dOkCancelDialog-top" Name="dOkCancelDialog"
Caption="Find Run" Top="290" Height="196" Width="409" designerClass="DesForm"
Left="248">
<dSizer SlotCount="3" designerClass="LayoutSizer" Orientation="Vertical">
<dLabel Caption="Run ID:" sizerInfo="{'HAlign': 'Left'}"
designerClass="controlMix"></dLabel>
<dTextBox RegID="txtRunID" sizerInfo="{}"
designerClass="controlMix"></dTextBox>
<dPanel sizerInfo="{'BorderSides': ['All'], 'HAlign': 'Left', 'VAlign':
'Top', 'Border': 0}" designerClass="LayoutPanel"></dPanel>
</dSizer>
</dOkCancelDialog>
I also have the additional code for the afterInitAll() as described below.
that's it.
I made a test form that has only a single button that calls this dialog.
Here's the onHit code for calling the dialog:
## *!* ## Dabo Code ID: dButton-dPanel
def onHit(self, evt):
dlg = dabo.ui.createForm("findRun3.cdxml", self)
dlg.show()
# execution pauses here until the dialog is hidden
if dlg.Accepted:
# User clicked OK
FindStr = dlg.txtRunID.Value
dabo.ui.info(FindStr)
dlg.release()
When I click the button, popup appears centered, with cursor in txtRunID
field. If I drag the popup off center and close it, it reappears centered
again (without focus on txtRunID). If I then enter some text, and click OK, I
get the proper behavior. ?!
I note that I haven't done anything to explicitly "hide" the dialog. Is the
normal behavior of this dialog to hide, rather than close when clicking
OK?
> I would do this: give the textbox a RegID value (let's say it's
> 'maintext'), and then add this code to the dialog's afterInitAll():
>
> self.maintext.setFocus()
Perfect, thanks!
Thanks again for all your help!
Jonathan Poor
**************A Good Credit Score is 700 or Above. See yours in just 2 easy
steps!
(http://pr.atwola.com/promoclk/100126575x1222846709x1201493018/aol?redir=http://www.freecreditreport.com/pm/default.aspx?sc=668072&hmpgID=115&bcd
=JulystepsfooterNO115)
--- 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]