Mike Mabey wrote:
> Hi all,
>
> I'm trying to change the string value of one of the choices in a dRadioList
> on the fly while the app is running. I want the currently displayed choices
> in the Radio List to reflect the values in corresponding dTextBoxes, even
> after the user manually changes them. My problem is that I can't get the
> new value to display, even though I can verify that the list value is
> changing.
>
> After giving the radio list a RegID, "dateRecordSheet", I have the following
> code attached to the dTextBox:
>
> def onInteractiveChange(self, evt):
> frm = self.Form
> radioObj = frm.dateRecordSheet
> newVal = self.Value
> print radioObj.Choices[0]
> radioObj.Choices[0] = "Sheet 1: "+newVal
> print radioObj.Choices[0]
>
> With the print statements, I've verified that the list value is changing.
> However, I have tried using each of the following after the code above
> without any success in getting the new value of the dTextBox to show up in
> the dRadioList:
>
> radioObj.refresh()
> radioObj.refresh(True)
> radioObj.redraw(True)
> radioObj.recreate()
>
> I'm sure you can guess that I'm just trying everything I think might
> possibly work. Can someone please tell me what (if anything) will make the
> app behave the way I want?
>
> I'm running this in the ClassDesigner under Windoze Vista with revision
> 5293. The app isn't giving any errors at all, so this is all the
> information I have.
You have to set the Choices property all over again, instead of
reassigning one element in the Choices property. For instance, this
would work:
radioObj.Choices[0] = "Sheet 1: "+newVal
radioObj.Choices = radioObj.Choices
However, that will fail until you upgrade to r5294, due to an oversight
on our part from way back when.
Paul
_______________________________________________
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]