0

Serialization/Deserialization of components

asked 2009-04-27 09:15:26 +0800

gaskauge gravatar image gaskauge
34 2

Hi,

I have a scenario where I need to store the state of a Portallayout in a cookie when the user changes the portal components and restore it back at a later time (portal behaviour). This seems to work OK, and I use the onClose/onMaximize/onMinimize/onMove events to store the state of the Portalchildren. I have a PortalController that does:

List<Portalchildren> children = (List<Portalchildren>) SerializationHelper.fromString(userCookie.getValue());
for (Portalchildren child : children) {                           
    comp.appendChild(child);
}

in the doAfterCompose(comp) method. If there is no cookie (default setup) I create the components using

Executions.createComponents("/someportal.zul", parent, null);

and adding all the eventlisteners to this component after creation.

The contents of someportal.zul:

<?component name="clientInfoPanel"  inline="true" macroURI="/WEB-INF/macros/clientInfoPanel.zul"?>

<portalchildren apply="my.company.com.ClientController"  style="padding: 5px" width="25%">

    <clientInfoPanel title="Client info"/>

</portalchildren>

The problems are:

-When the components are restored in the PortalController above, the ClientController defined in the "apply" attribute is not invoked
-The events are not propagated to the restored components.

Am I doing this the wrong way, or can I expect this to work somehow?


Thanks

delete flag offensive retag edit
Be the first one to reply this discussion!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-04-27 09:15:26 +0800

Seen: 112 times

Last updated: Apr 27 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More