You Are Here:

Community: Developer Discussion Boards

#1 Old forms & tabs together not working - 2008-12-13, 22:49

Join Date: Dec 2008
Posts: 13
trymukesh
Offline
Registered User
Buddies,

am trying to use tabs and forms together.
but it seems when form gets activated, tabs disappears from the screen.

my requirement is simple
2 tabs having one form each.

can anyone send me a quick sample code?

cheers,
m
Reply With Quote

#2 Old Re: forms & tabs together not working - 2008-12-13, 23:43

Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Send a message via Skype™ to Rafael T.
Rafael T.'s Avatar
Rafael T.
Offline
Forum Nokia Champion
Hi trymukesh,

Wouldn't be better if you put your current code here and we try to correct it? Don't forget to use the code tags by clicking on the # symbol at the post editor


Waiting your code,

Rafael.
Reply With Quote

#3 Old Re: forms & tabs together not working - 2008-12-14, 10:30

Join Date: Dec 2008
Posts: 13
trymukesh
Offline
Registered User
Quote:
Originally Posted by Rafael T. View Post
Hi trymukesh,

Wouldn't be better if you put your current code here and we try to correct it? Don't forget to use the code tags by clicking on the # symbol at the post editor


Waiting your code,

Rafael.
Hi Rafael,

Thanks for the quick response, here is the code

Million thanks in anticipation.

warm regards,
M

Code:
import e32, appuifw, math

# create an Active Object
app_lock = e32.Ao_lock()

## Simple MyFormView class to demonstrate the use of forms.
class MyFormView( object ):
    
    ## The constructor.
    def __init__( self ):
        ## Bool
        self._iIsSaved = False
 
        ## Country list.
        self._iCountries = [u'India', u'USA', u'UK', u'Finland', u'Canada']

        ## Form fields.
        self._iFields = [(u'Weight (kgs)','float', 10.10), 
                         (u'Country','combo', (self._iCountries,0))]
 
 
    ## Displays the form.
    def setActive( self ):
        self._iIsSaved = False
        self._iForm = appuifw.Form(self._iFields, appuifw.FFormEditModeOnly)
	self._iForm.menu = [(u"Nano",self.tata),(u"Ikon",self.ford)]
        self._iForm.save_hook = self._markSaved
        self._iForm.flags = appuifw.FFormEditModeOnly
        self._iForm.execute( )
 
    ## save_hook send True if the form has been saved.
    def _markSaved( self, aBool ):
        self._iIsSaved = aBool
 
     ## save_hook send True if the form has been saved.
    def tata( self ):
	appuifw.note(  unicode(self._iForm[0][2]) , 'info' )
                
    ## save_hook send True if the form has been saved.
    def ford( self ):
	appuifw.note(  unicode(self._iForm[0][2]) , 'info' )
                
    ## _iIsSaved getter.
    def isSaved( self ):
        return self._iIsSaved
 
    # here you can put for example all the getters you need:
    #---------------------------------------------------------
 
    ## Return mobile field value.
    def getWeight( self ):
        return self._iForm[0][2]

    def getCountry( self ):
        return self._iCountries[self._iForm[1][2][1]].encode( "utf-8" )
 
#Create a tab handler that switches between tabs
def handle_tab(index):
	#Switch to the tab according to index
	if(index==0):
		appuifw.app.body = tab1
	if(index==1):
		appuifw.app.body = tab2
 
 
def exit_key_handler():
    app_lock.signal()
 
if __name__ == "__main__":

    tab1 = appuifw.Text(u"My Tab 1")
    tab2 = appuifw.Text(u"My Tab 2")
 
    ##Set the tabs
    appuifw.app.set_tabs([u"One", u"Two"], handle_tab)
 
    #Set the default tab to the first tab, for example
    appuifw.app.body = tab1
	
    #appuifw.app.title = u'Trying out forms'

    myForm = MyFormView( )

    myForm.setActive( )
    if myForm.isSaved( ):
        print myForm.getWeight( )
        print myForm.getCountry( )

    appuifw.app.exit_key_handler = exit_key_handler
    app_lock.wait()
Reply With Quote

#4 Old Re: forms & tabs together not working - 2008-12-14, 14:13

Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Send a message via Skype™ to Rafael T.
Rafael T.'s Avatar
Rafael T.
Offline
Forum Nokia Champion
Hi trymukesh,

Well, I tested you code here. If I were you, I wouldn't use forms in this case, because the default behavior of the tabs if pressing the right and left arrows to switch them, but in your case, it's a form, so it will be in edit mode and if you press right/left the keys, it won't change the tabs. Sorry if this was confusing, hope you can understand

Instead, you can use a listbox


Hope it helps,

Rafael.
Reply With Quote

#5 Old Re: forms & tabs together not working - 2008-12-16, 18:38

Join Date: Dec 2008
Posts: 13
trymukesh
Offline
Registered User
Quote:
Originally Posted by Rafael T. View Post
Hi trymukesh,

Well, I tested you code here. If I were you, I wouldn't use forms in this case, because the default behavior of the tabs if pressing the right and left arrows to switch them, but in your case, it's a form, so it will be in edit mode and if you press right/left the keys, it won't change the tabs. Sorry if this was confusing, hope you can understand

Instead, you can use a listbox


Hope it helps,

Rafael.
Hi Rafael,

Thank you for your guidance.
Just to avoid last minute jitters, i stuck to form and curb some functionality of my application.

Thanks pal,
Mukesh
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
appuifw Tabs and forms stobbsc Python 3 2008-10-08 11:54
Forms NOT working XDnl Symbian User Interface 14 2008-07-10 17:51
tabs & text editor sumit.rathi General Symbian C++ 4 2008-07-04 18:13
Working in the emulator, not working on the mobile?? sabb0ur General Browsing 2 2003-08-06 21:27
7650 / BlueUSB Bluetooth USB dongle / PC-suite not working! mahaikol Bluetooth Technology 7 2002-12-28 07:47

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