4 Replies Latest reply on Mar 11, 2010 9:23 PM by 843851

    Navigate within HlistGroup Elements

      Hi everyone
      I am trying to develop an app in which the user has to navigate through a list of elements; so somebody suggested the optimal way would be using a HListGroup.
      What i need for each row is something like this:

      (Icon) Text1 Text2 Text3

      Up to now, I have been able to add an icon and a text to each row; what I'd like to do is be navigate through the elements, and know which one has the focus, as there is a HStaticText which changes depending on which element is selected. But I haven't been able to navigate within the elements, it's the whole HListGroup which has the focus, and that's all.
      Does anybody know how I should do this? And how do I know which item is selected? I have seen a method called listGroup.getCurrentItem(); should I combine this with some kind of listener?
      Thanks a lot in advance!

        • 1. An answer + a question
          Hi, trying a couple of things I finally found the way, I don't know if it's the best way or not, but it works. Now just a little question: i've seen i can choose the background color for the HlistGroup but, what i need is a transparent background for it, and a coloured background for the element which has the focus. Can this be done or am I asking too much?

          Thanks once more to everyone

          P.S. Just in case it might be useful, what I did was add a keylistener, and when u press up/down, it does the following:

               my_counter--; // or ++
          • 2. Re: Navigate within HlistGroup Elements
            you should look at the HFocusTraversal(HNavigable, HNavigable, HNavigable, HNavigable) method. It has worked well for me when doing things similar to what you describe.
            • 3. Re: Navigate within HlistGroup Elements
              I'm new to Havi api.
              Can u please send me an complete example code which display HListGroup and HListElemets to smpshehan@gmail.com.
              I'll be very thankful to u.
              • 4. Re: An answer + a question

                I am new to java tv and I am trying to use HListgroup and finding it really hard to navigate inspite of having keylisteners. Do you mind please sharing your code?