How to make mobile labels (or any text) selectable?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

How to make mobile labels (or any text) selectable?

Alexei Vinidiktov
Hi,

My mobile app needs to detect what word was tapped by the user to show him or her the translation of that word. 

It would be ideal if the user could tap any displayed text and the app would detect the tapped word, but in case it's not possible, the minimum requirement is to be able to detect taps on rich text displayed in labels or embedded html.

I can do the second scenario in a desktop app but not in a mobile app as there seems to be no way to select text in mobile labels.

Any advice would be greatly appreciated.

--
Alexei Vinidiktov

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to make mobile labels (or any text) selectable?

czuendorf
I would just use a TextArea, and then get the CaretPosition with JavaScript directly.

Greetz Christopher


Am 04.06.2014 um 17:14 schrieb Alexei Vinidiktov <[hidden email]>:

> Hi,
>
> My mobile app needs to detect what word was tapped by the user to show him or her the translation of that word.
>
> It would be ideal if the user could tap any displayed text and the app would detect the tapped word, but in case it's not possible, the minimum requirement is to be able to detect taps on rich text displayed in labels or embedded html.
>
> I can do the second scenario in a desktop app but not in a mobile app as there seems to be no way to select text in mobile labels.
>
> Any advice would be greatly appreciated.
>
> --
> Alexei Vinidiktov
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/NeoTech_______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to make mobile labels (or any text) selectable?

Alexei Vinidiktov
Thanks for your suggestion, Christopher.

I've managed to get word selection to work in text areas on the iPad, Android tablets and Windows tablets.

But still there is a problem.

I can't get multiline text to display properly in Internet Explorer. Text split by new line characters '\n' is displayed as one line in IE.

The qooxdoo mobile demo exhibits the same problem:


The terms of service on the Form demo are displayed as a one-line string. 


On Wed, Jun 4, 2014 at 11:29 PM, Christopher Zündorf <[hidden email]> wrote:
I would just use a TextArea, and then get the CaretPosition with JavaScript directly.

Greetz Christopher


Am 04.06.2014 um 17:14 schrieb Alexei Vinidiktov <[hidden email]>:

> Hi,
>
> My mobile app needs to detect what word was tapped by the user to show him or her the translation of that word.
>
> It would be ideal if the user could tap any displayed text and the app would detect the tapped word, but in case it's not possible, the minimum requirement is to be able to detect taps on rich text displayed in labels or embedded html.
>
> I can do the second scenario in a desktop app but not in a mobile app as there seems to be no way to select text in mobile labels.
>
> Any advice would be greatly appreciated.
>
> --
> Alexei Vinidiktov
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/NeoTech_______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel



--
Alexei Vinidiktov

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to make mobile labels (or any text) selectable?

czuendorf
I found the following solution:



Am 05.06.2014 um 12:46 schrieb Alexei Vinidiktov <[hidden email]>:

\n


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to make mobile labels (or any text) selectable?

Alexei Vinidiktov
I need some more help.

I'm not sure how I can add <br> tags to the value of the qx.mobile.form.TextArea.

If I set the value like this:  myTextArea.setValue("First paragraph <br><br> Second paragraph"); instead of two paragraphs I get one that is displayed as is - with the <br><br> tags. 

Text areas display only plain text, don't they?

This js snippet shows that inserting '\r\n' characters works fine in plain html text areas but not in qooxdoo.




On Thu, Jun 5, 2014 at 6:28 PM, Christopher Zündorf <[hidden email]> wrote:
I found the following solution:



Am 05.06.2014 um 12:46 schrieb Alexei Vinidiktov <[hidden email]>:

\n


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel




--
Alexei Vinidiktov

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to make mobile labels (or any text) selectable?

czuendorf
Ok,

this looks like a bug to me.

You always can modify the value of the widget through textArea.getContentElement().value = "foo"

This may work as a workaround.

Could you open a bug for this problem?

Greetz Christopher



Am 05.06.2014 um 15:29 schrieb Alexei Vinidiktov <[hidden email]>:

I need some more help.

I'm not sure how I can add <br> tags to the value of the qx.mobile.form.TextArea.

If I set the value like this:  myTextArea.setValue("First paragraph <br><br> Second paragraph"); instead of two paragraphs I get one that is displayed as is - with the <br><br> tags. 

Text areas display only plain text, don't they?

This js snippet shows that inserting '\r\n' characters works fine in plain html text areas but not in qooxdoo.




On Thu, Jun 5, 2014 at 6:28 PM, Christopher Zündorf <[hidden email]> wrote:
I found the following solution:



Am 05.06.2014 um 12:46 schrieb Alexei Vinidiktov <[hidden email]>:

\n


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel




--
Alexei Vinidiktov
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to make mobile labels (or any text) selectable?

Alexei Vinidiktov
The suggested workaround doesn't seem to work either.

I've filed this as Bug 8402


On Thu, Jun 5, 2014 at 9:09 PM, Christopher Zündorf <[hidden email]> wrote:
Ok,

this looks like a bug to me.

You always can modify the value of the widget through textArea.getContentElement().value = "foo"

This may work as a workaround.

Could you open a bug for this problem?

Greetz Christopher



Am 05.06.2014 um 15:29 schrieb Alexei Vinidiktov <[hidden email]>:

I need some more help.

I'm not sure how I can add <br> tags to the value of the qx.mobile.form.TextArea.

If I set the value like this:  myTextArea.setValue("First paragraph <br><br> Second paragraph"); instead of two paragraphs I get one that is displayed as is - with the <br><br> tags. 

Text areas display only plain text, don't they?

This js snippet shows that inserting '\r\n' characters works fine in plain html text areas but not in qooxdoo.




On Thu, Jun 5, 2014 at 6:28 PM, Christopher Zündorf <[hidden email]> wrote:
I found the following solution:



Am 05.06.2014 um 12:46 schrieb Alexei Vinidiktov <[hidden email]>:

\n


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel




--
Alexei Vinidiktov
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel




--
Alexei Vinidiktov

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to make mobile labels (or any text) selectable?

Alexei Vinidiktov
I really need this bug fixed. How can I help fixing it? Where should I start?


On Thu, Jun 5, 2014 at 10:28 PM, Alexei Vinidiktov <[hidden email]> wrote:
The suggested workaround doesn't seem to work either.

I've filed this as Bug 8402


On Thu, Jun 5, 2014 at 9:09 PM, Christopher Zündorf <[hidden email]> wrote:
Ok,

this looks like a bug to me.

You always can modify the value of the widget through textArea.getContentElement().value = "foo"

This may work as a workaround.

Could you open a bug for this problem?

Greetz Christopher



Am 05.06.2014 um 15:29 schrieb Alexei Vinidiktov <[hidden email]>:

I need some more help.

I'm not sure how I can add <br> tags to the value of the qx.mobile.form.TextArea.

If I set the value like this:  myTextArea.setValue("First paragraph <br><br> Second paragraph"); instead of two paragraphs I get one that is displayed as is - with the <br><br> tags. 

Text areas display only plain text, don't they?

This js snippet shows that inserting '\r\n' characters works fine in plain html text areas but not in qooxdoo.




On Thu, Jun 5, 2014 at 6:28 PM, Christopher Zündorf <[hidden email]> wrote:
I found the following solution:



Am 05.06.2014 um 12:46 schrieb Alexei Vinidiktov <[hidden email]>:

\n


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel




--
Alexei Vinidiktov
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel




--
Alexei Vinidiktov



--
Alexei Vinidiktov

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel