Thanks Barry, the squeezer now works, but now I am having problem passing
the object to and from component on the page. Becouse the error is so weird,
I conclude something is wrong with component parametrs not being properly
handled. It works without the component. Page includes component

   <component id="categoryBox" type="CategoryBox">
       <binding name="category" value="category"/>
       <binding name="children" value="children"/>
       <binding name="listener" value="listeners.onClickCategory"/>
   </component>

The component gets a list (children) which are value objects registered for
squeezing and their parent (category - also the same type) and should
display a list of their names. When a child category is clicked the
component sends a message through listener to the page that contains it to
invoke

  public IPage onClickCategory(CategoryVO categoryVO) {
     WizardStep2 wizardStep2 = getWizardStep2Page();
     wizardStep2.setCategory(categoryVO);
     return (IPage) wizardStep2;
  }

which should display children's children, but instead I am getting the

Could not load class com.package.ClassName from WebappClassLoader delegate:
false repositories: /WEB-INF/classes/ ----------> Parent Classloader:
[EMAIL PROTECTED] :
com.package.ClassName

In my

  public Collection getChildren() {
     logger.info("get children of " + getCategory());
     Collection children = getManager().getChildren(getCategory(), null);
     logger.info("= " + children);
     return children;
  }

page class method getCategory() returns null. The setter and getter are
defined

  abstract public CategoryVO getCategory();
  abstract public void setCategory(CategoryVO categoryVO);

Advice appreciated!


2006/9/6, Barry Books <[EMAIL PROTECTED]>:

Here is mine. Just add the state manager as a property and pull out
what you need.

public Object unsqueeze(DataSqueezer squeezer, String string) {
                try {
                        Repository repository = (Repository)
stateManager.get("repository");
                        User user = (User) stateManager.get("user");
                        return repository.select(user, new Long(
string.substring(1)));
                } catch (NumberFormatException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
                return null;
        }


        private ApplicationStateManager stateManager;
        public void setStateManager(ApplicationStateManager stateManager)
{
               this.stateManager = stateManager;
        }
}

<contribution configuration-id="tapestry.state.ApplicationObjects">
  <state-object name="user" scope="session">
    <create-instance class="com.trsvax.mill.baseobject.party.User"/>
  </state-object>
</contribution>

<contribution configuration-id="tapestry.data.SqueezeAdaptors">
<adaptor object="service:millSqueezer"/>
</contribution>

<service-point interface="com.trsvax.mill.MillSqueezer" id="millSqueezer">
<invoke-factory>
<construct class="com.trsvax.mill.MillSqueezer">
       <set-object property="stateManager"
value="infrastructure:applicationStateManager"/>
</construct>
</invoke-factory>
</service-point>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to