Skip to Content

Issue working with a htmlb Tray

I have a tray in an iView with some data in it. I am trying to query the state of the tray in order to preserve the persistence of if the tray is collapsed or not so the state is the same after a page refresh.

I tried doing the follow (as I have for all other components):

<b>Tray textTray = (Tray) getComponentByName("textTray");

if (textTray != null)




In order to fetch the component information form the jsp page and save it in a bean...

I noticed this never worked and when I debugged it I found that the textTray tray object was always null.

I tossed this line and debugged:

<b>Component comps[] = getComponents();</b>

and found that the tray object never appears in the array of components.

I was wondering if anyone knew how to access this tray in my iView. I think I have found a work around if not using the onCollapse event but would like to keep things the same if possible.



Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 20, 2005 at 10:05 PM


    Only components of a form are available in the java part of the code, as only their values are submitted for the HTTP post/get event.

    You will need to do some client side javascripting in order to get the tray status I believe, and would than have to make the value found part of the form that is submitted (using standard html you would update an input field of type="hidden", but I am not quite sure how you do it htmlb).


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 21, 2005 at 04:14 PM

    I used the events onCollapse and onExpand to capture the current state of the tray... all they do is set the bean value that get pulled to the JSP on a page refresh...


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.