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)
{
bean.setTextTrayIsCollapsed(textTray.isCollapsed());
}</b>
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.
cheers,
D.
Hi,
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).
Dagfinn
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...
D.
Add a comment