Martin,
I followed your advice how to  give the Bootswatch Theme functionality toa Tree 
component.
I made the following Implementation:
MyNestedTree :
public MyNestedTree(String id, ITreeProvider<MyFoo> provider, 
IModel<Set<MyFoo>> state) 
{ super(id, provider, state); add(new 
BootswatchThemeProvider().getTheme(Bootstrap.getSettings(getApplication()).getActiveThemeProvider().getActiveTheme().name().toLowerCase()));

Where BootswatchThemeProvider is:

public class BootswatchThemeProvider  { 
Map<String,Behavior> map = new HashMap<String,Behavior>();
   public BootswatchThemeProvider() {
  map.put("windows", new WindowsTheme());  map.put("human", new HumanTheme());  
map.put("flatly", new FlatlyTheme());
 }

 public Behavior getTheme(String name){  if(map.containsKey(name)) return 
(Behavior) map.get(name);
 else return (Behavior) map.get("windows"); }
}

When I open the Tree it's OK
But when I change the Theme I get the error:

Last cause: Unable to find component with id 'tree' in 
[TransparentWebMarkupContainer [Component id = wicket_extend2]]
Expected: 'html:wicket_child1:wicket_extend2:tree'.
Found with similar names: ''

Markup
The problem is in 
"file:/home/java/wicket/appfuse/braunimmobilien-eclipse-maven/project/webapp-bootstrap/target/classes/braunimmobilien/bootstrap/webapp/pages/angebot/AngebotTree.html":
| <wicket:extend>
<header class="jumbotron subhead" id="overview">
    <div class="container">
        <h1>Offers</h1>        <p class="lead">All offers ever available.</p>
    </div>
</header><div class="container"><div class="row"><div class="col-lg-9">         
 <div class="bs-docs-example">    <div wicket:id="tree">[tree]</div>
</div>
</div>
</div>
</div>
 </wicket:extend> |

| Root cause:Unable to find component with id 'tree' in 
[TransparentWebMarkupContainer [Component id = wicket_extend2]]
Expected: 'html:wicket_child1:wicket_extend2:tree'.
Found with similar names: ''
MarkupStream: [markup = 
file:/home/java/wicket/appfuse/braunimmobilien-eclipse-maven/project/webapp-bootstrap/target/classes/braunimmobilien/bootstrap/webapp/pages/angebot/AngebotTree.html
<wicket:extend>
<header class="jumbotron subhead" id="overview">
<div class="container">
<h1>Offers</h1> <p class="lead">All offers ever available.</p>
</div>
</header><div class="container"><div class="row"><div class="col-lg-9">  
<div class="bs-docs-example"> <div wicket:id="tree">[tree]</div>
</div>
</div>
</div>
</div>
</wicket:extend>, index = 2, current = '<div wicket:id="tree">' (line 0, column 
0)]
at 
org.apache.wicket.markup.MarkupStream.throwMarkupException(MarkupStream.java:526)

I am using 0.9.9-Bootstrap.
      Von: Martin Grigorov <[email protected]>
 An: "[email protected]" <[email protected]> 
 Gesendet: 22:43 Sonntag, 31.Mai 2015
 Betreff: Re: Wicket Bootstrap 0.9.9 is released
   
Hi,

Sorry, the provided information is highly insufficient for any of us to
help you!
Please give some more details.

P.S. the subject is not related to your question.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov



On Sun, May 31, 2015 at 11:06 AM, hansheinrichbraun <
[email protected]> wrote:

> Martin,
>
> can you explain me why i get the error Unable to find component with id
> 'tree' in  [ TransparentWebMarkupContainer for my NestedTree component when
> I change the Theme?
>
>
> Von Samsung Mobile gesendet


  

Reply via email to