0

I am trying to have a horizontally scrolling table within a HTMLComponent as the tables can be wider than the width of the mobile phone and I don't want the user to have a wrapped table. I set setScrollableX(true) for HTMLTable, but I am having a lot of problems getting focus in and out of the different components. Any tips on how I would go about achieving this?

Gooner
  • 1,380
  • 2
  • 14
  • 25

1 Answers1

1

Focus in LWUIT is a mixed bag of issues and the HTML component inherits quite allot of them. The Browser demo available in LWUIT's SVN ( http://java.net/projects/lwuit/sources/svn/show ) has a feature that allows showing a "mouse pointer" within the browser window so you can avoid focus and just point at a cell. I'm not sure if it was tested with side scrolling but its possibly the easiest approach to make this UI more usable.

Shai Almog
  • 51,749
  • 5
  • 35
  • 65
  • @Shai Thanks! However I don't see such an option in ver 1.4. How do I enable it? I have the browser and the rest of the code with me. – Gooner May 24 '11 at 12:04
  • You can get the code from the browser demo which contains most of the code. However, that code relies on changes made to the SVN version of LWUIT. LWUIT 1.5 should be out soon (hopefully) so migrating to the SVN would prepare you for that more easily. – Shai Almog May 25 '11 at 03:50
  • Ah, so the mouse pointer functionality isn't there in the code I checked out from 1.4, including the browser demo and the core library? – Gooner May 25 '11 at 04:37
  • Also, I have been thinking that if this doesn't work out, can I have horizontal scrolling on the HTMLComponent for the only and have the text in the same vertical view as the mobile screen? That is. the users might have o scroll horizontally to read a table, but he wouldn't need to scroll horizontally to read text?
    – Gooner May 25 '11 at 04:38
  • 1.4 is the binary download. The SVN linked above contains all the code mentioned. You can selectively scroll horizontally in LWUIT but not in the HTML component. – Shai Almog May 25 '11 at 10:23
  • Argh! Can you think about implementing that in future releases? – Gooner May 25 '11 at 11:24
  • Its an HTML issue not a LWUIT issue. You would need frames support to get something like this which isn't really practical on a phone screen (or any screen for that matter its an awful UI experience). Why do you need this functionality to be in HTML? – Shai Almog May 25 '11 at 18:30
  • Hmm, I think there is a little bit of a confusion. Here is an image to show you what I mean - http://postimage.org/image/2xc3c2qtg/ddd65459/ (Click on it to make it bigger) – Gooner May 26 '11 at 07:51
  • I understood you perfectly. My answers apply. – Shai Almog May 26 '11 at 09:22
  • So is there no way to implement this in a HTMLComponent? Maybe play around with the widths of the Containers, as you see that nothing other than the HTMLComponent is scrollable? – Gooner May 26 '11 at 09:28
  • And yeah, even if there is no selective scrolling, it's okay. Because, I can use one horizontal scroll to do the job for me(which'll be on the HTMLComponent). I want to know if I can control the width of tables and p tags programmatically, that is, like how I mentioned on the image taht I posted earlier. Right now, setting setScrollableX(true) for the HTMLComponent makes the text to expand as well. I want only the table to expand. – Gooner May 26 '11 at 09:42
  • I don't understand why you are using HTML component if you want so much control? Why not just write LWUIT code or use the GUI builder? You can always wait for an HTML page load and loop over the HTML component widgets (they are all LWUIT components internally) and change everything about them, however this would be very specific to the current implementation and VERY fragile. – Shai Almog May 29 '11 at 10:53
  • I see, I'll try that out. Using LWUIT's HTML components will make some sense. But doing that according to the webpage's HTML markup makes it tough right? I need to show only Wikipedia pages, so yes, the implementation will be fixed. – Gooner May 30 '11 at 07:55
  • Basically all I want to implement is to have my tables stretched as much tas they want and my text in the current vertical view in a HTMLComponent that is scrollable towards X and Y both. – Gooner May 30 '11 at 09:51