This might help you:

public abstract class AbstractVelocityPanel extends VelocityPanel
{
//**********************************************************************************************************************
// Fields
//**********************************************************************************************************************

    private final IStringResourceStream templateResource;
    private boolean parseGeneratedMarkup = true;

    protected abstract void populateVelocityContext(Map<String,Object> context);

//**********************************************************************************************************************
// Constructors
//**********************************************************************************************************************

    protected AbstractVelocityPanel(String id)
    {
        super(id, Model.valueOf(Collections.emptyMap()));
        setModel(new DetachableVelocityContextModel());
        this.templateResource = new PackageResourceStream(getClass(),
getClass().getSimpleName() + ".vm");
    }


    private class DetachableVelocityContextModel extends LoadableDetachableModel
    {
        protected Object load()
        {
            final Map<String,Object> context = new HashMap<String,Object>();
            populateVelocityContext(context);
            return context;
        }
    }
//**********************************************************************************************************************
// Getter/Setter Methods
//**********************************************************************************************************************

    protected IStringResourceStream getTemplateResource()
    {
        return templateResource;
    }

//**********************************************************************************************************************
// Other Methods
//**********************************************************************************************************************

    protected boolean parseGeneratedMarkup()
    {
        return parseGeneratedMarkup;
    }

    public void setParseGeneratedMarkup(boolean parseGeneratedMarkup)
    {
        this.parseGeneratedMarkup = parseGeneratedMarkup;
    }

    protected boolean getStatelessHint()
    {
        return true;
    }
}


On Thu, Sep 11, 2008 at 10:40 AM, James Carman
<[EMAIL PROTECTED]> wrote:
> You can use Velocity to generate HTML and then have Wicket parse that
> resulting markup.  Check out the wicket-velocity subproject.
>
> On Thu, Sep 11, 2008 at 10:34 AM, Adriano dos Santos Fernandes
> <[EMAIL PROTECTED]> wrote:
>> Can wicket be used with dynamic (generated) HTML?
>>
>> I mean, for example, HTML is generated to a stream based on a table metadata
>> and wicket reads that stream and call the page class to add logic (also
>> querying the metadata) to it normally (as if the HTML was static).
>>
>> If yes, can anyone point out how should I start to do it?
>>
>> Thanks,
>>
>>
>> Adriano
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>

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

Reply via email to