| Reply | « Previous Thread | Next Thread » |
|
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, ![]() |
| Vik The Red |
| View Public Profile |
| Find all posts by Vik The Red |
|
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( )
Last edited by Vik The Red : 2008-03-28 at 10:36.
|
| Vik The Red |
| View Public Profile |
| Find all posts by Vik The Red |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
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 |
|
hey....
my problem is solved now... had to make use of "self._iForm" Thanks ![]() |
| Vik The Red |
| View Public Profile |
| Find all posts by Vik The Red |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| 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 |