You Are Here:

Community: Developer Discussion Boards

#1 Old Lightbulb Access Combo-box elements in a form - 2008-03-28, 09:56

Join Date: Mar 2008
Posts: 10
Vik The Red
Offline
Registered User
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,
Reply With Quote

#2 Old Re: Access Combo-box elements in a form - 2008-03-28, 10:18

Join Date: Mar 2008
Posts: 10
Vik The Red
Offline
Registered User
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 10:36.
Reply With Quote

#3 Old Re: Access Combo-box elements in a form - 2008-03-28, 18:33

Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Online
Forum Nokia Champion
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.


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote

#4 Old Re: Access Combo-box elements in a form - 2008-03-28, 18:43

Join Date: Mar 2008
Posts: 10
Vik The Red
Offline
Registered User
hey....
my problem is solved now... had to make use of "self._iForm"

Thanks
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
regarding selection list box and form using carbide ui designer chirumar Symbian User Interface 7 2006-10-06 15:46
how to create a Form like Lockcode form? sarvestan Mobile Java General 2 2006-08-29 21:15
Cannot create form Norrit_ Symbian User Interface 1 2006-03-08 16:21
[bug report] Form view corrupted when using long text entry with combo simo.salminen Python 1 2006-03-06 09:41
Submitting a Form Query wysraj General Browsing 1 2004-02-17 09:38

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d81449X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZpythonQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZuserE5ftagQSxpythonX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ