You Are Here:

Community: Developer Discussion Boards

Reply « Previous Thread | Next Thread »

#1 Old Can we add listeners to the form to listen any changes in the form fields? - 2008-06-27, 06:56

Join Date: Jan 2008
Posts: 27
Location: Gurgaon, India
shail229's Avatar
shail229
Offline
Registered User
In J2ME, we can add listeners to the form to listen the changes of form fields(from items). Similarly in PyS60, can we add listeners to the form (appuifw.Form) which can listen any changes in the fields and take appropriate action?
Reply With Quote

#2 Old Re: Can we add listeners to the form to listen any changes in the form fields? - 2008-06-27, 07:15

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
Offline
Forum Nokia Champion
Quote:
Originally Posted by shail229 View Post
In J2ME, we can add listeners to the form to listen the changes of form fields(from items). Similarly in PyS60, can we add listeners to the form (appuifw.Form) which can listen any changes in the fields and take appropriate action?
hi shail229
i think you have gone crazy with the forms
sorry to ask you this question can you explain in bit detail what do you mean by listening the changes.


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

Forum Nokia Python Wiki


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

#3 Old Re: Can we add listeners to the form to listen any changes in the form fields? - 2008-06-27, 07:39

Join Date: Jan 2008
Posts: 27
Location: Gurgaon, India
shail229's Avatar
shail229
Offline
Registered User
Let me explain you the problem. Suppose I have four fields all of type numbers (say with labels "amount1", "amount2", "amount3" and "total") in my form. Now what I want is that when user enters numbers in "amount1", "amount2", "amount3" then "total" should show the total of all the numbers automatically. Actually I want "total" field to be non-editable, but can't do in the PyS60 form. Also whenever user change any value in any of the "amount1", "amount2", "amount3" field, value in "total" should be changed.

There are many other use cases of this feature. All these things are doable in J2ME.
Reply With Quote

#4 Old Re: Can we add listeners to the form to listen any changes in the form fields? - 2008-06-27, 08:16

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
Offline
Forum Nokia Champion
hi shail229
really sorry but as far as i know PyS60 doesnt have the things you are talking about. you must try it with symbian c++.


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

Forum Nokia Python Wiki


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

#5 Old Re: Can we add listeners to the form to listen any changes in the form fields? - 2008-06-27, 08:20

Join Date: May 2007
Posts: 2,738
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Quote:
Originally Posted by shail229 View Post
Let me explain you the problem. Suppose I have four fields all of type numbers (say with labels "amount1", "amount2", "amount3" and "total") in my form. Now what I want is that when user enters numbers in "amount1", "amount2", "amount3" then "total" should show the total of all the numbers automatically. Actually I want "total" field to be non-editable, but can't do in the PyS60 form. Also whenever user change any value in any of the "amount1", "amount2", "amount3" field, value in "total" should be changed.

There are many other use cases of this feature. All these things are doable in J2ME.
So you need a Dynamic Form

Thats interesting, how about trying the widsets? They offer such things with easy. May be Python would not be your cup of tea yet mate

Best Regards,
Croozeus
Last edited by croozeus : 2008-06-27 at 08:21. Reason: Added Quote
Reply With Quote

#6 Old Re: Can we add listeners to the form to listen any changes in the form fields? - 2008-06-27, 09:11

Join Date: Jan 2008
Posts: 27
Location: Gurgaon, India
shail229's Avatar
shail229
Offline
Registered User
Ya, it looks like that PyS60 does not have what I want (until I touch the source code). Actually I heard a lot of PyS60, so I tried to develop my application in it. But my experience was not good.

I have seen multiple libraries in PyS60 like for reading sms, getting IMEI numbers and for lots of other things (which are not available in J2ME). And there is only few lines of codes for that. It increased my interest, but when I start coding for my application I observed that PyS60 does not support basic GUI related features, which J2ME supports.

Now the question is whether I should go back to J2ME or I have to touch the source code of PyS60
Reply With Quote

#7 Old Re: Can we add listeners to the form to listen any changes in the form fields? - 2008-06-27, 09:20

Join Date: May 2007
Posts: 2,738
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Quote:
Originally Posted by shail229 View Post
Ya, it looks like that PyS60 does not have what I want (until I touch the source code). Actually I heard a lot of PyS60, so I tried to develop my application in it. But my experience was not good.

I have seen multiple libraries in PyS60 like for reading sms, getting IMEI numbers and for lots of other things (which are not available in J2ME). And there is only few lines of codes for that. It increased my interest, but when I start coding for my application I observed that PyS60 does not support basic GUI related features, which J2ME supports.

Now the question is whether I should go back to J2ME or I have to touch the source code of PyS60
You can create some native extensions in C++ which you could exploit with Python. If you are not good at C++ may be hire someone who can do it for you.

Best Regards,
Croozeus
Reply With Quote

#8 Old Re: Can we add listeners to the form to listen any changes in the form fields? - 2008-07-11, 03:18

Join Date: Jul 2008
Posts: 3
shalabio
Offline
Registered User
I don't think you're asking too much from python, actually some of these features do exist, except the read_only thing, but you'll have to press save first and everytime you change the value and want to see the result,
in the save_hook procedure the argument given is the current form, so change it accordingly and return True, which will update the form.
Code:
def savehook(saved):
	if (saved):
                result=saved[0][2]+saved[1][2]
		saved[2]=(u'Total','number',result)
                return True
Last edited by shalabio : 2008-07-12 at 01:53. Reason: readability
Reply With Quote

#9 Old Re: Can we add listeners to the form to listen any changes in the form fields? - 2008-07-11, 09:53

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
Offline
Forum Nokia Champion
hi shalabio
first of all a warm welcome to the forum nokia dibo.
good idea but from the next time you put any code please use the code tags so that everybody can understand.
thanks


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

Forum Nokia Python Wiki


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

#10 Old Re: Can we add listeners to the form to listen any changes in the form fields? - 2008-07-11, 10:00

Join Date: Jun 2005
Posts: 382
y.a.k
Offline
Regular Contributor
I would redesign the thing using a Listbox. This way you can validate the values in real-time and have a read-only fields. Forms are quite limited with their modal design so leave them for the simpliest cases. The only thing you won't get with a Listbox are in-line editable fields. For example when user points on a list entry "amount1" and selects it, an appuifw.query appears asking him for the value. Clicking on "total" would do nothing.

I think this is the best you will get and it's not that different from other Symbian apps. It's quite intuitive too.
Reply With Quote

#11 Old Re: Can we add listeners to the form to listen any changes in the form fields? - 2008-07-12, 04:49

Join Date: Jul 2008
Posts: 3
shalabio
Offline
Registered User
Thanx gaba88 for your welcome, and advice taken.
The listbox approach is also a very good way, but i was just replying to question about forms and you're right forms are not very convenient but sometimes they do the work faster when we're not dealing with complexe ones.
Reply With Quote

#12 Old Re: Can we add listeners to the form to listen any changes in the form fields? - 2008-07-12, 05:29

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
Offline
Forum Nokia Champion
Quote:
Originally Posted by shalabio View Post
Thanx gaba88 for your welcome, and advice taken.
The listbox approach is also a very good way, but i was just replying to question about forms and you're right forms are not very convenient but sometimes they do the work faster when we're not dealing with complexe ones.
Hi Shalabio
Yes definately correct the forms play important parts in some applications but when it comes over some thing like switching screens or any other complex things.
its bit difficult to dealt with them.


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

Forum Nokia Python Wiki


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

#13 Old Re: Can we add listeners to the form to listen any changes in the form fields? - 2008-07-14, 13:05

Join Date: Jan 2008
Posts: 27
Location: Gurgaon, India
shail229's Avatar
shail229
Offline
Registered User
Quote:
Originally Posted by y.a.k View Post
I would redesign the thing using a Listbox. This way you can validate the values in real-time and have a read-only fields. Forms are quite limited with their modal design so leave them for the simpliest cases. The only thing you won't get with a Listbox are in-line editable fields. For example when user points on a list entry "amount1" and selects it, an appuifw.query appears asking him for the value. Clicking on "total" would do nothing.

I think this is the best you will get and it's not that different from other Symbian apps. It's quite intuitive too.
Also we can't add our commands in the list box. As inline edit facility will not be available in the list box and we have to use appuifw.query for entering value for each field then each time we have to create a new list box and execute it (to show the entered value).
Reply With Quote

#14 Old Re: Can we add listeners to the form to listen any changes in the form fields? - 2008-07-14, 13:15

Join Date: Jun 2005
Posts: 382
y.a.k
Offline
Regular Contributor
Quote:
Originally Posted by shail229 View Post
Also we can't add our commands in the list box. As inline edit facility will not be available in the list box and we have to use appuifw.query for entering value for each field then each time we have to create a new list box and execute it (to show the entered value).
Not true. You can use the existing Listbox and use its .set_list() method to refresh the list every time the value changes. You can also make the current item stay as selected.

This model works quite well as I use it to implement a settings dialog in my Ped editor.
Reply With Quote

#15 Old Re: Can we add listeners to the form to listen any changes in the form fields? - 2008-07-14, 13:32

Join Date: Jan 2008
Posts: 27
Location: Gurgaon, India
shail229's Avatar
shail229
Offline
Registered User
Quote:
Originally Posted by y.a.k View Post
Not true. You can use the existing Listbox and use its .set_list() method to refresh the list every time the value changes. You can also make the current item stay as selected.
Ya you are right, actually I was confused with the appuifw.selection_list, I am a beginner in PyS60 so made this mistake.

But still the problem of adding commands in the list is there and ListBox will not give the feel of a form to the users (problem of inline editing).
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
How can I add a popup field to the form dynamically stelee Symbian User Interface 0 2005-09-05 11:19
how to add canvas in form in midlet mathi77in Mobile Java General 1 2005-07-13 08:50
how to add edit menu on the form shafali gupta Symbian User Interface 4 2005-05-30 03:39
Is it safe to add new items to form from thread ? kakoskin Mobile Java Media (Graphics & Sounds) 0 2004-10-12 10:24
Nokia 6600 - Add custom fields to Contact entries awdhaan General Discussion 2 2004-01-08 19: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