You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Brown, Berlin [GCG-PFS]" <Be...@Primerica.com> on 2011/09/29 05:05:14 UTC

Dynamic Markup Content in Wicket (1.4+)

Does anyone have an article on how to add dynamic content such that the
content isn't defined in the markup at compile time.  It is generated at
runtime.
 
For example.
 
Old Way - Listing1
 
<div wicket:id="containers">     
  <div wicket:id="container1">
  </div>
  <div wicket:id="container2"> 
  </div>
</div>
 
...
With dynamic content - Listing2
 
<div wicket:id="containers">     
   <!-- Dynamic Content Wicket Ids, container1, container2 -->
</div>
...
 
I could use an offline, compile time tool to generate the markup and
then add it to my project. But I wanted to see if there is something
more dynamic.
 
I also, could use something like a ListView or Repeater, but I wanted to
avoid that because of legacy java code.  
 
The Java code is structured such that 'containers' has sub-components
'container1' ***
 
It is easier refactor the Java code or have some system to add some kind
of dynamic content that would look like the HTML in Listing1.
 
UseCase: For Igor,
 
The use-case is just as I described, there are some cases where you have
legacy Wicket Java code.   It costs more to modify the Java code and
retest the logic so I wanted to be able to 'refactor' my markup and
clean at least the markup without making major changes to the Java
hierarchy structure.
 
 I want to have a HTML markup that looks like this but would act like
the listing in listing1 above. 
<div wicket:id="containers">     
   <!-- Dynamic Content Wicket Ids, container1, container2 -->
</div>
 
 
 
 

Re: Dynamic Markup Content in Wicket (1.4+)

Posted by Igor Vaynberg <ig...@gmail.com>.
any component can implement IMarkupResourceStreamProvider and return
whatever markup it wants wicket to use. If you need a fine-tuned
control over the caching mechanism for this markup you can also let
your components implement IMarkupCacheKeyProvider.

-igor


On Wed, Sep 28, 2011 at 8:05 PM, Brown, Berlin [GCG-PFS]
<Be...@primerica.com> wrote:
> Does anyone have an article on how to add dynamic content such that the
> content isn't defined in the markup at compile time.  It is generated at
> runtime.
>
> For example.
>
> Old Way - Listing1
>
> <div wicket:id="containers">
>  <div wicket:id="container1">
>  </div>
>  <div wicket:id="container2">
>  </div>
> </div>
>
> ...
> With dynamic content - Listing2
>
> <div wicket:id="containers">
>   <!-- Dynamic Content Wicket Ids, container1, container2 -->
> </div>
> ...
>
> I could use an offline, compile time tool to generate the markup and
> then add it to my project. But I wanted to see if there is something
> more dynamic.
>
> I also, could use something like a ListView or Repeater, but I wanted to
> avoid that because of legacy java code.
>
> The Java code is structured such that 'containers' has sub-components
> 'container1' ***
>
> It is easier refactor the Java code or have some system to add some kind
> of dynamic content that would look like the HTML in Listing1.
>
> UseCase: For Igor,
>
> The use-case is just as I described, there are some cases where you have
> legacy Wicket Java code.   It costs more to modify the Java code and
> retest the logic so I wanted to be able to 'refactor' my markup and
> clean at least the markup without making major changes to the Java
> hierarchy structure.
>
>  I want to have a HTML markup that looks like this but would act like
> the listing in listing1 above.
> <div wicket:id="containers">
>   <!-- Dynamic Content Wicket Ids, container1, container2 -->
> </div>
>
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Dynamic Markup Content in Wicket (1.4+)

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
I remember we discussed it before:

http://apache-wicket.1842946.n4.nabble.com/Wicket-MashUpContainer-td1893282.html



2011/9/29 Brown, Berlin [GCG-PFS] <Be...@primerica.com>:
> Does anyone have an article on how to add dynamic content such that the
> content isn't defined in the markup at compile time.  It is generated at
> runtime.
>
> For example.
>
> Old Way - Listing1
>
> <div wicket:id="containers">
>  <div wicket:id="container1">
>  </div>
>  <div wicket:id="container2">
>  </div>
> </div>
>
> ...
> With dynamic content - Listing2
>
> <div wicket:id="containers">
>   <!-- Dynamic Content Wicket Ids, container1, container2 -->
> </div>
> ...
>
> I could use an offline, compile time tool to generate the markup and
> then add it to my project. But I wanted to see if there is something
> more dynamic.
>
> I also, could use something like a ListView or Repeater, but I wanted to
> avoid that because of legacy java code.
>
> The Java code is structured such that 'containers' has sub-components
> 'container1' ***
>
> It is easier refactor the Java code or have some system to add some kind
> of dynamic content that would look like the HTML in Listing1.
>
> UseCase: For Igor,
>
> The use-case is just as I described, there are some cases where you have
> legacy Wicket Java code.   It costs more to modify the Java code and
> retest the logic so I wanted to be able to 'refactor' my markup and
> clean at least the markup without making major changes to the Java
> hierarchy structure.
>
>  I want to have a HTML markup that looks like this but would act like
> the listing in listing1 above.
> <div wicket:id="containers">
>   <!-- Dynamic Content Wicket Ids, container1, container2 -->
> </div>
>
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org