Re: Panel switching in LinkTree.onNodeLinkClicked() doesn't work

2009-05-27 Thread Bucyrus

Im using a org.apache.wicket.extensions.markup.html.tree.Tree now instead of
a LinkTree. This seems to work.
Don't forget to call setOutputMarkupId ( true) for all panels before they
get displayed.
-- 
View this message in context: 
http://www.nabble.com/Panel-switching-in-LinkTree.onNodeLinkClicked%28%29-doesn%27t-work-tp23708299p23738359.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Panel switching in LinkTree.onNodeLinkClicked() doesn't work

2009-05-27 Thread Bucyrus



Andreas Bürgel (Bucyrus) wrote:
 
 Im using a org.apache.wicket.extensions.markup.html.tree.Tree now instead
 of a LinkTree. This seems to work.
 Don't forget to call setOutputMarkupId ( true) for all panels before
 they get displayed.
 

I forgot to say that had to add the panel to the AjaxRequestTarget to make
it really work: 

-8-
protected void onNodeLinkClicked ( AjaxRequestTarget pTarget, TreeNode
pNode) {
NavigationTreeNode lNode = (NavigationTreeNode) pNode;
switch ( lNode.getType ()) {
case PANEL:
System.out.println ( PANEL_NODE);
Object lPayLoad = lNode.getPayLoad ();
setMainPanel ( lMMCSystemPanel);

if ( null != pTarget) {
pTarget.addComponent ( lMMCSystemPanel);
}
break;
-8--

Enough said on this issue, I hope.
-- 
View this message in context: 
http://www.nabble.com/Panel-switching-in-LinkTree.onNodeLinkClicked%28%29-doesn%27t-work-tp23708299p23738707.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Panel switching in LinkTree.onNodeLinkClicked() doesn't work

2009-05-25 Thread Bürgel , Andreas
Hi folks,

I want to exchange panels when special nodes of my main navigation tree object 
are clicked

8
public class Index extends AbstractPage {
// constants

private static String ID_MAIN_PANEL = main_panel;
private static String ID_NAVIGATION_TREE = fbc_navigation_tree;

// attributes

private LinkTree myNavigationTree = null;
protected Panel myMainPanel = null;

// constructors

public Index ( final PageParameters pParameters) {
final EmptyPanel lEmptyPanel = new EmptyPanel ( ID_MAIN_PANEL);
final MMCSystemPanel lMMCSystemPanel = new MMCSystemPanel ( 
ID_MAIN_PANEL, new MMCSystem ());
 
myMainPanel = lEmptyPanel;
add ( myMainPanel);

myNavigationTree = new LinkTree ( ID_NAVIGATION_TREE, 
getApp().getNavigationTreeModel ()) {
@Override
protected void onNodeLinkClicked ( Object pNode, 
BaseTree pTree, AjaxRequestTarget pTarget) {
NavigationTreeNode lNode = (NavigationTreeNode) 
pNode;

switch ( lNode.getType ()) {
case PANEL:
System.out.println ( 
PANEL_NODE);
Object lPayLoad = 
lNode.getPayLoad ();
//MMCSystemPanel lPanel = new 
MMCSystemPanel ( ID_MAIN_PANEL, (MMCSystem) lPayLoad);
setMainPanel ( 
lMMCSystemPanel);
break;

case SUB_TREE_ROOT:
setMainPanel ( lEmptyPanel);

if ( 
pTree.getTreeState().isNodeExpanded ( pNode)) {

pTree.getTreeState().collapseNode ( pNode);
} else {

pTree.getTreeState().expandNode ( pNode);
}
break;

case DEAD:
System.out.println ( 
DEAD_NODE);
break;
}
}
};

add ( myNavigationTree);

add ( new Link ( swap) {
private boolean myFlag = true;

@Override
public void onClick () {
if ( myFlag) {
setMainPanel ( lMMCSystemPanel);
} else {
setMainPanel ( lEmptyPanel);
}

myFlag = ! myFlag;
}

});

myNavigationTree.getTreeState().expandAll ();
}
 

// methods
 
public void setMainPanel ( Panel pPanel) {
myMainPanel.replaceWith ( pPanel);
myMainPanel = pPanel;
}
8 

For testing I also added a link (id=swap) that should toggle between two panels 
when clicked.
While clicking the swap-link produces the expected result, clicking nodes of my 
tree doesn't switch the panel (but produces the output PANEL_NODE to console).
Any ideas?
I'm using Firefox 3.0.10, SUN Java(TM) SE Runtime Environment (build 
1.6.0_10-b33), wicket 1.4-rc4 (also tested 1.4-rc2) on Linux

Thanks in advance.

Mit freundlichen Grueszen, / With kind regards,
 
i.A. Andreas Buergel
BUCYRUS (R)
Engineering Center
Automation
Longwall Division
Industriestr. 1, D-44534 Luenen
Tel: +49 (2306) 709 2509
Fax: +49 (2306) 709 1315 2509
mailto: andreas.buer...@de.bucyrus.com
http://www.bucyrus.com
Bucyrus DBT Europe GmbH
Sitz der Gesellschaft: Luenen, Registergericht: Amtsgericht Dortmund, 
Handelsregister HRB 17120
Geschaeftsfuehrung: Luis de Leon (Sprecher), Dr. Ulrich Noll  Vorsitzender des 
Aufsichtsrates: Dr. Juergen W. Stadelhofer

Diese E-Mail enthaelt vertrauliche und/oder rechtlich