×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    10

    Lightbulb Access Combo-box elements in a form

    Hi All,

    I am trying to create an application with a form consisting of a combo-box. How can i access the current selected element or index of the combo-box. Something like getSelectedIndex() in Java.

    I've used selection_list(), but it displays the combo-box again. Is there any other alternative?
    Thanks,

  2. #2
    Registered User
    Join Date
    Mar 2008
    Posts
    10

    Re: Access Combo-box elements in a form

    I'm using this code



    Code:
    import appuifw
     
    walltype=[u'Hi',u'Bye']
    
    ## Simple MyFormView class to demonstrate the use of forms.
    class MyFormView( object ):
        
        ## The constructor.
        def __init__( self ):
            ## Bool
            self._iIsSaved = False
     
            ## Form fields.
            self._iFields = [(u'Wall Type','combo', (walltype,0))]
    
        def send( self ):
            if self.isSaved() == False:
    		appuifw.note(u"Save The Form First", "error")
                    
            else:
                    smsmsg = "#" + str(self._iFields[0][2][0][index])+ ","
    		appuifw.note(unicode(smsmsg), "conf")
    		
    
                    self._iIsSaved = False 
        ## Displays the form.
        def setActive( self ):
            self._iIsSaved = False
            self._iForm = appuifw.Form(self._iFields, appuifw.FFormEditModeOnly)
            self._iForm.save_hook = self._markSaved
            self._iForm.flags = appuifw.FFormEditModeOnly
            self._iForm.menu = [(u"Send",self.send)]
            
            self._iForm.execute( )
     
     
        ## save_hook send True if the form has been saved.
        def _markSaved( self, aBool ):
            self._iIsSaved = aBool
     
                    
        ## _iIsSaved getter.
        def isSaved( self ):
            return self._iIsSaved
     
        # here you can put for example all the getters you need:
        #---------------------------------------------------------
     
        
      
     
     
     
    if __name__ == "__main__":
        appuifw.app.title = u'Try Forms'
        myForm = MyFormView( )
        myForm.setActive( )
    I want to know what index is
    Last edited by Vik The Red; 2008-03-28 at 09:36.

  3. #3
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: Access Combo-box elements in a form

    hi Vik The Red
    as fas as i m thinking the index in the code means that the elements you are passing your comobo box.
    as in the present code you have taken the elements as hi and bye.
    hope u got the point.
    plz give feedback.
    thanx.

  4. #4
    Registered User
    Join Date
    Mar 2008
    Posts
    10

    Re: Access Combo-box elements in a form

    hey....
    my problem is solved now... had to make use of "self._iForm"

    Thanks

Similar Threads

  1. regarding selection list box and form using carbide ui designer
    By chirumar in forum Symbian User Interface
    Replies: 7
    Last Post: 2006-10-06, 14:46
  2. how to create a Form like Lockcode form?
    By sarvestan in forum Mobile Java General
    Replies: 2
    Last Post: 2006-08-29, 20:15
  3. Cannot create form
    By Norrit_ in forum Symbian User Interface
    Replies: 1
    Last Post: 2006-03-08, 15:21
  4. Replies: 1
    Last Post: 2006-03-06, 08:41

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×