On Tue, November 24, 2015 01:11, Dan Haywood wrote:
> On 21 November 2015 at 20:21, Kevin Meyer <[email protected]> wrote:
>
>
>> Following up on this, I seem to be missing something.
>>
>>
>> In my PanelFactory, I am trying to detect an annotation. I have the
>> following:
>>
>>
>> @Override
>> protected ApplicationAdvice appliesTo(IModel<?> model) { if (model
>> instanceof ScalarModel) { Object obj = model.getObject();
>> if (obj != null) { if (obj instanceof PojoAdapter) { PojoAdapter po =
>> (PojoAdapter) obj;
>>
>> ... snip ...
>>
> Your PanelFactory is looking for the @Html annotation on a class
> definition, not on a field definition.
>


Is that really the case?  With the model being ScalarModel (and I think in
the factory I'm installing the component with SCALAR_NAME_AND_VALUE).

When I debug, the obj that's coming in (above) is the String that holds
the property in question.

>> I remember something about facts, should I rather be working with them?
>>
>>
> Facets, (I presume you mis-spelt).

Indeed, yes! Facets..

>
> Yes, that would usually be the pattern; write an HtmlFacetFactory to
> install a corresponding HtmlFacet, added to the property.
>
> in the Wicket UI, subclass ComponentFactoryScalarAbstract and in the
> applesTo override to also check that
> scalarModel.containsFacet(HtmlFacet.class).

I'll look into this..

Regards,
Kevin

-- 
Kevin Meyer
Ljubljana, Slovenia


Reply via email to