| Reply | « Previous Thread | Next Thread » |
|
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?
|
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Offline
Forum Nokia Champion
|
|
|
Quote:
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 |
|
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. |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
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 |
|
Quote:
![]() 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
|
|
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 ![]() |
|
Quote:
Best Regards, Croozeus |
|
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
|
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
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 |
|
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. |
|
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. |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Offline
Forum Nokia Champion
|
|
|
Quote:
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 |
|
Quote:
|
|
Quote:
This model works quite well as I use it to implement a settings dialog in my Ped editor. |
|
Quote:
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 | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| 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 |