4 Replies Latest reply on Mar 2, 2009 3:05 PM by nnmmooppqq

    Force itemRenderer Redraw

    nnmmooppqq Level 1
      I need to force a redraw for a list itemrenderer. The code is attached. Basically, I have a quiz question with the option in a list, preceeded by a radio button. The data is coming from XML, which identifies the correct option and an isSelected attribute that stores which option the user chose. When the radio is clicked, I do the following:

      Set isSelected to 1 on the coorect XML node.
      Set the style for the correct option to a changed background and bolded text
      Make the list unselectable.
      Display the explanation.

      Everything works EXCEPT: The item renderer for the correct item doesn't resize. It only displays 1 line.

      I've tried a number of things, including invalidateList(), validateNow(), invalidateDisplayList() -- both before and after the code identifying the correct option in the list.

      Please help!

      Thanks.
        • 1. Re: Force itemRenderer Redraw
          Level 7

          "nnmmooppqq" <webforumsuser@macromedia.com> wrote in message
          news:gohbor$93n$1@forums.macromedia.com...
          >I need to force a redraw for a list itemrenderer. The code is attached.
          > Basically, I have a quiz question with the option in a list, preceeded by
          > a
          > radio button. The data is coming from XML, which identifies the correct
          > option
          > and an isSelected attribute that stores which option the user chose. When
          > the
          > radio is clicked, I do the following:
          >
          > Set isSelected to 1 on the coorect XML node.
          > Set the style for the correct option to a changed background and bolded
          > text
          > Make the list unselectable.
          > Display the explanation.
          >
          > Everything works EXCEPT: The item renderer for the correct item doesn't
          > resize. It only displays 1 line.
          >
          > I've tried a number of things, including invalidateList(), validateNow(),
          > invalidateDisplayList() -- both before and after the code identifying the
          > correct option in the list.

          You haven't said what kind of control this is in. Some controls will allow
          you to do this with variableRowHeight set to true, but some won't allow
          resizing of renderers at runtime at all. You might want to also try calling
          invalidateSize() on your renderer.

          HTH;

          Amy


          • 2. Re: Force itemRenderer Redraw
            nnmmooppqq Level 1
            Amy,

            Thanks for the reply. The control is a list. I've tried (all without success):

            invalidateList()
            invalidateSize()
            validateNow()
            invalidateDisplayList()

            ???

            Thanks.
            • 3. Re: Force itemRenderer Redraw
              Level 7

              "nnmmooppqq" <webforumsuser@macromedia.com> wrote in message
              news:gohhir$g18$1@forums.macromedia.com...
              > Amy,
              >
              > Thanks for the reply. The control is a list. I've tried (all without
              > success):
              >
              > invalidateList()
              > invalidateSize()
              > validateNow()
              > invalidateDisplayList()
              >
              > ???
              >

              Did you try setting variableRowHeight="true" on the List?


              • 4. Re: Force itemRenderer Redraw
                nnmmooppqq Level 1
                Yes. VariableRowHeight=true