Mobile pick help..! SOLVED

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
snop21
Posts: 90
Joined: Mon Jan 20, 2014 2:54 pm

Mobile pick help..! SOLVED

Post by snop21 » Thu Feb 13, 2014 2:49 pm

hello guys..

I have a sample mobile selection here using Mobilepick my problem is I can't display the value only the string only the index.

I attached the stack here..

Any help very much appreciated..

Thank you..

-snop21
Attachments
mobilelselection.livecode.zip
(1.56 KiB) Downloaded 310 times
Last edited by snop21 on Fri Feb 21, 2014 4:51 am, edited 1 time in total.

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Mobile pick help..!

Post by Klaus » Thu Feb 13, 2014 3:09 pm

Hi Snop21,

1. you forgot to add a FIELD named "txtDisplay"!? 8)
2. use the result to get the LINENUMBER of your optionlist!

This works:
...
put "one" & cr & "two" & cr & "three" & cr & "four" into optionList
mobilePick optionList, 1
put the result into x

## Here:
put line x of optionlist into tUserResult
answer tUserResult
...


Best

Klaus

snop21
Posts: 90
Joined: Mon Jan 20, 2014 2:54 pm

Re: Mobile pick help..!

Post by snop21 » Thu Feb 13, 2014 4:24 pm

Klaus,


You are the Best...! :))

Thanks Klaus..

-- Is possible to have smooth scroller on this? incase alot of data inserted to it.. what method will I use?

Regards
-snop21

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Mobile pick help..!

Post by Klaus » Thu Feb 13, 2014 4:31 pm

Hi Snop21,
snop21 wrote:Klaus,
You are the Best...! :))
I know! :D
snop21 wrote:-- Is possible to have smooth scroller on this?
Where "this" is what? 8)


Best

Klaus

snop21
Posts: 90
Joined: Mon Jan 20, 2014 2:54 pm

Re: Mobile pick help..!

Post by snop21 » Thu Feb 13, 2014 4:42 pm

klaus,


the data in the list using mobilepick. I tried to put alot of data to it and doesn't work anymore. What is in my mind is to put scroller to it.
But I dont know how to do it.

Thanks klaus

-snop21

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Mobile pick help..!

Post by Klaus » Thu Feb 13, 2014 4:54 pm

I don't think this is possible, since the PICKER is provided by the underlying OS
and you cannot "wrap" a native scroller around it.

In that case you might need/want to make you own "picker" using a LIST FIELD or something.

snop21
Posts: 90
Joined: Mon Jan 20, 2014 2:54 pm

Re: Mobile pick help..!

Post by snop21 » Thu Feb 13, 2014 5:28 pm

Klaus,


Thanks klaus..

Regards

-snop21

FabricioRocha
Posts: 25
Joined: Sun Jan 19, 2014 8:53 pm

Re: Mobile pick help..!

Post by FabricioRocha » Thu Feb 20, 2014 5:55 am

If it could be useful to anybody, I made a small function which receives as parameters as many items you would like to be shown in a mobilePick, and returns the selected item string:

Code: Select all

function PopMenu
    set the itemDelimiter to return
    if the paramCount = 0 then
        exit PopMenu
    end if
    put "" into menuoptions
    repeat with i = 0 to the paramCount
        put param(i) into item i of menuoptions
    end repeat

    mobilePick menuoptions
    put item (the result) of menuoptions into chosen

    return chosen
end PopMenu
Easier to use, I think...

Regards!

Fabricio Rocha
Brasilia, Brasil

snop21
Posts: 90
Joined: Mon Jan 20, 2014 2:54 pm

Re: Mobile pick help..!

Post by snop21 » Thu Feb 20, 2014 9:20 am

hi FabricioRocha,


Thank you.. I got it working now..!

But my problem now is how can I put the data into the MobilePick? My Data came from my query.

I attached the the file.

In my file I retrieved data from query and put it into the datagrid but I really want to put it to the MobilePick instead.

Regards

-snop21
Attachments
QueryMoBilePick.livecode.zip
sample
(1.15 KiB) Downloaded 292 times

Post Reply