[Gambas-user] More null problems

Stephen Bungay sbungay at ...981...
Mon Apr 20 14:27:02 CEST 2009


   It is the nature of radio buttons to allow only one in a set to be 
toggled on, If you really want to go that route then I would suggest 
that you use checkboxes instead of radio buttons, A better way (IMHO) is 
to place a third button on the form labelled as "Unknown" and set that 
one when the gender is a null.

Bruce wrote:
> I have a set of two radio buttons in a panel control (Male & Female),  when a 
> new person object is loaded into the form I need to set the gender 
> appropriately.  However, some persons' gender is not known, say for "Brown, 
> J" and I am trying unsuccessfully to set both radio buttons to reflect this.
> 
> IF p.gender = "M" THEN
> 	rbMale.Value = TRUE
> 	rbFemale.Value = FALSE
> ELSE IF p.gender = "F" THEN
> 	rbMale.Value = FALSE
> 	rbFemale.Value = TRUE		'OK So far, but...
> ELSE
> 	rbMale.Value = FALSE
> 	rbFemale.Value = FALSE
> ENDIF
> 
> In the unknowns case, the radiobuttons are always left in the state they were 
> in on the previous object.  So, if I go from Brown, Hillary (F) to Brown, J 
> the value is left as for Hillary.  But if I go from Brown, Kevin (M) to 
> Brown, J its left as for Kevin.
> 
> I've also tried setting both rb Values to NULL but this gives the same result.
> 
> 
> Any clues?
> 
> tia
> Bruce
> 
> ------------------------------------------------------------------------------
> Stay on top of everything new and different, both inside and 
> around Java (TM) technology - register by April 22, and save
> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
> 300 plus technical and hands-on sessions. Register today. 
> Use priority code J9JMT32. http://p.sf.net/sfu/p
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 




More information about the User mailing list