On 13.06.2008, at 16:47, James Carman wrote:

I think you're doing a bit too much work here.  StringResourceModel
allows you to pass in IModel objects as its "parameters" (check the
javadocs), so you could pass in an IModel that returns your "size"
parameter that is calculated at runtime.

If you mean that StringResourceModelWithCount is a little overkill,
then: yes, you are of course right; my class is nothing but syntactic
sugar. It makes the class's client code look a little more readable,
I feel.

Or did you mean the code in StringResourceModelWithCount itself?

public StringResourceModelWithCount(String resourceKey, Component<? > component, IModel<?> model)
  {
    // Construct
super(resourceKey, component, model, new Object[] { new Model<Integer>() {

      @Override
      public Integer getObject()
      {
        return getCount();
      }

    }});
  }

obviously does not work (method referenced at construction time).
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to