I have a component that loads on the browser via JavaScript JSON-data from the server. The data depends on the component's model and needs to be loaded from a URL. My approach so far was to create a subclass DataSource of DynamicWebResource, and to do
in my component's constructor:

  MyComponent(String id, Model model)
  {
    super(id, model);

    final DataSource resource = new DataSource();
resourceReference = new ResourceReference(MyComponent.class, "something")
    {
      @Override
      protected Resource newResource()
      {
        return resource;
      }
    };
  }

  private class DataSource extends DynamicWebResource
  // uses MyComponent.this.getDefaultModel() to obtain data
  ...

However, this registers my component class (and not the instance) with the resource and all subsequently constructed components still point to the old resource. How can I register a resource reference (or, what I actually want: just the
resource) with the component AND get a URL for it?

Thanks very much for any guidance.
Kaspar

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

Reply via email to