Re: LinkTree and DownloadLink

2010-06-23 Thread Ernesto Reinaldo Barreiro
Anna,

Third parameter ( Example DownloadLink in your case) is just an
alternative fine name: see onClick() method to see how it is used. Can
you try following panel?

import java.io.File;

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.DownloadLink;
import org.apache.wicket.markup.html.panel.Panel;

public class DownLoadLinkPanel extends Panel {

private static final long serialVersionUID = 1L;

/**
 * @param id
 */
public DownLoadLinkPanel(String id) {
super(id);
DownloadLink dl = new DownloadLink( download, new File(
wat-application/images/addmore.jpg ), AddMore.jpg );
add(dl);
dl.add(new Label(text, Example DownloadLink));
}

}



DownLoadLinkPanel.html

wicket:panel
a wicket:id=downloadspan wicket:id=text/span/a
/wicket:panel

---

and then

return new DownLoadLinkPanel(componentId);

Ernesto

On Tue, Jun 22, 2010 at 10:43 PM, Anna Simbirtsev asimbirt...@gmail.com wrote:
 I think the problem is in this: DownloadLink dl = new DownloadLink( id, new
 File( wat-application/images/addmore.jpg ), Example DownloadLink );

 This does not produce any output.

 On Tue, Jun 22, 2010 at 4:18 PM, Ernesto Reinaldo Barreiro 
 reier...@gmail.com wrote:

 Not sure but I think if you put Link on a span you will have a
 generated markup span onclick=/span which might not be visible.
 Why don't you use a panel like following?

 wicket:panel
   a wicket:id=downloadspan wicket:id=text/span/a
 /wicket:panel

 Ernesto


 On Tue, Jun 22, 2010 at 9:09 PM, Anna Simbirtsev asimbirt...@gmail.com
 wrote:
  Thanks
 
  Do you know why if I add DownloadLink directly without the panel, its
  invisible?
 
  On Tue, Jun 22, 2010 at 2:55 PM, Ernesto Reinaldo Barreiro 
  reier...@gmail.com wrote:
 
  Your MyPanel extends Form and Form should be applied to form tag not
  span tag.
 
  Ernesto
 
  On Tue, Jun 22, 2010 at 7:50 PM, Anna Simbirtsev asimbirt...@gmail.com
 
  wrote:
   Hi,
  
   I am trying to extend newNodeComponent on a LinkTree to make nodes
   DownLoadLink.
  
   tree = new LinkTree(tree, createTreeModel()){
  
   private static final long serialVersionUID = 1L;
  
   @Override
               protected Component newNodeComponent( String id, IModel
 model
  )
   {
                       return new LinkIconPanel( id, model, this ) {
  
                          private static final long serialVersionUID =
 1L;
  
   @Override
                               protected Component newContentComponent(
  String
   componentId, BaseTree tree, IModel model ) {
                                       Object obj = ( (
  DefaultMutableTreeNode
   )model.getObject() ).getUserObject();
                                       if( !obj.equals(1:subtree...,
   2:subtree..., 3:subtree...) ) {
                                       LOGGER.debug(link);
                                       return new MyPanel(componentId);
                                       }
  
                                       return new Label( componentId,
   model.getObject().toString() );
                               }
  
                       };
               }
    };
       form.add(tree);
       tree.getTreeState().collapseAll();
  
  
  
         public class MyPanel extends Form   {
  
  
           private static final long serialVersionUID = 1L;
  
           MyPanel(String id) {
           super(id);
  
           DownloadLink dl = new DownloadLink( id, new File(
   wat-application/images/addmore.jpg ), Example DownloadLink );
           add(dl);
           }
    }
  
  
   I copied the example from:
   http://www.wicket-library.com/wicket-examples/ajax/tree/simple.0
  
  
   But i get the following error:
   WicketMessage: Component content must be applied to a tag of type
 'form',
   not 'span wicket:id=content class=content id=content21' (line
 0,
   column 0)
  
  
   wicket:panel
   table class=icon-paneltrtd wicket:id=iconLinkimg
  wicket:id=icon
   class=icon//tdtd class=contenta
 wicket:id=contentLinkspan
   wicket:id=content class=content/span/a/td/tr/table
   /wicket:panel, index = 8, current = 'span wicket:id=content
   class=content' (line 19, column 144)]
  
   Thanks
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
  --
  Anna Simbirtsev
  (416) 729-7331
 

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




 --
 Anna Simbirtsev
 (416) 729-7331


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



Re: LinkTree and DownloadLink

2010-06-23 Thread Anna Simbirtsev
Thank you, its showing now.


On Wed, Jun 23, 2010 at 3:24 AM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 Anna,

 Third parameter ( Example DownloadLink in your case) is just an
 alternative fine name: see onClick() method to see how it is used. Can
 you try following panel?

 import java.io.File;

 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.link.DownloadLink;
 import org.apache.wicket.markup.html.panel.Panel;

 public class DownLoadLinkPanel extends Panel {

private static final long serialVersionUID = 1L;

 /**
 * @param id
 */
public DownLoadLinkPanel(String id) {
super(id);
DownloadLink dl = new DownloadLink( download, new File(
wat-application/images/addmore.jpg ), AddMore.jpg );
add(dl);
dl.add(new Label(text, Example DownloadLink));
}

 }

 

 DownLoadLinkPanel.html

 wicket:panel
 a wicket:id=downloadspan wicket:id=text/span/a
 /wicket:panel

 ---

 and then

 return new DownLoadLinkPanel(componentId);

 Ernesto

 On Tue, Jun 22, 2010 at 10:43 PM, Anna Simbirtsev asimbirt...@gmail.com
 wrote:
  I think the problem is in this: DownloadLink dl = new DownloadLink( id,
 new
  File( wat-application/images/addmore.jpg ), Example DownloadLink );
 
  This does not produce any output.
 
  On Tue, Jun 22, 2010 at 4:18 PM, Ernesto Reinaldo Barreiro 
  reier...@gmail.com wrote:
 
  Not sure but I think if you put Link on a span you will have a
  generated markup span onclick=/span which might not be visible.
  Why don't you use a panel like following?
 
  wicket:panel
a wicket:id=downloadspan wicket:id=text/span/a
  /wicket:panel
 
  Ernesto
 
 
  On Tue, Jun 22, 2010 at 9:09 PM, Anna Simbirtsev asimbirt...@gmail.com
 
  wrote:
   Thanks
  
   Do you know why if I add DownloadLink directly without the panel, its
   invisible?
  
   On Tue, Jun 22, 2010 at 2:55 PM, Ernesto Reinaldo Barreiro 
   reier...@gmail.com wrote:
  
   Your MyPanel extends Form and Form should be applied to form tag
 not
   span tag.
  
   Ernesto
  
   On Tue, Jun 22, 2010 at 7:50 PM, Anna Simbirtsev 
 asimbirt...@gmail.com
  
   wrote:
Hi,
   
I am trying to extend newNodeComponent on a LinkTree to make nodes
DownLoadLink.
   
tree = new LinkTree(tree, createTreeModel()){
   
private static final long serialVersionUID = 1L;
   
@Override
protected Component newNodeComponent( String id, IModel
  model
   )
{
return new LinkIconPanel( id, model, this ) {
   
   private static final long serialVersionUID =
  1L;
   
@Override
protected Component
 newContentComponent(
   String
componentId, BaseTree tree, IModel model ) {
Object obj = ( (
   DefaultMutableTreeNode
)model.getObject() ).getUserObject();
if( !obj.equals(1:subtree...,
2:subtree..., 3:subtree...) ) {
LOGGER.debug(link);
return new
 MyPanel(componentId);
}
   
return new Label( componentId,
model.getObject().toString() );
}
   
};
}
 };
form.add(tree);
tree.getTreeState().collapseAll();
   
   
   
  public class MyPanel extends Form   {
   
   
private static final long serialVersionUID = 1L;
   
MyPanel(String id) {
super(id);
   
DownloadLink dl = new DownloadLink( id, new File(
wat-application/images/addmore.jpg ), Example DownloadLink );
add(dl);
}
 }
   
   
I copied the example from:
http://www.wicket-library.com/wicket-examples/ajax/tree/simple.0
   
   
But i get the following error:
WicketMessage: Component content must be applied to a tag of type
  'form',
not 'span wicket:id=content class=content id=content21'
 (line
  0,
column 0)
   
   
wicket:panel
table class=icon-paneltrtd wicket:id=iconLinkimg
   wicket:id=icon
class=icon//tdtd class=contenta
  wicket:id=contentLinkspan
wicket:id=content class=content/span/a/td/tr/table
/wicket:panel, index = 8, current = 'span wicket:id=content
class=content' (line 19, column 144)]
   
Thanks
   
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
  
  
   --
   Anna Simbirtsev
   (416) 729-7331
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e

LinkTree and DownloadLink

2010-06-22 Thread Anna Simbirtsev
Hi,

I am trying to extend newNodeComponent on a LinkTree to make nodes
DownLoadLink.

tree = new LinkTree(tree, createTreeModel()){

private static final long serialVersionUID = 1L;

@Override
 protected Component newNodeComponent( String id, IModel model )
{
 return new LinkIconPanel( id, model, this ) {

private static final long serialVersionUID = 1L;

@Override
 protected Component newContentComponent( String
componentId, BaseTree tree, IModel model ) {
 Object obj = ( ( DefaultMutableTreeNode
)model.getObject() ).getUserObject();
 if( !obj.equals(1:subtree...,
2:subtree..., 3:subtree...) ) {
 LOGGER.debug(link);
 return new MyPanel(componentId);
 }

 return new Label( componentId,
model.getObject().toString() );
 }

 };
 }
 };
 form.add(tree);
 tree.getTreeState().collapseAll();



   public class MyPanel extends Form   {


 private static final long serialVersionUID = 1L;

 MyPanel(String id) {
 super(id);

 DownloadLink dl = new DownloadLink( id, new File(
wat-application/images/addmore.jpg ), Example DownloadLink );
 add(dl);
 }
 }


I copied the example from:
http://www.wicket-library.com/wicket-examples/ajax/tree/simple.0


But i get the following error:
WicketMessage: Component content must be applied to a tag of type 'form',
not 'span wicket:id=content class=content id=content21' (line 0,
column 0)


wicket:panel
table class=icon-paneltrtd wicket:id=iconLinkimg wicket:id=icon
class=icon//tdtd class=contenta wicket:id=contentLinkspan
wicket:id=content class=content/span/a/td/tr/table
/wicket:panel, index = 8, current = 'span wicket:id=content
class=content' (line 19, column 144)]

Thanks


Re: LinkTree and DownloadLink

2010-06-22 Thread Ernesto Reinaldo Barreiro
Your MyPanel extends Form and Form should be applied to form tag not
span tag.

Ernesto

On Tue, Jun 22, 2010 at 7:50 PM, Anna Simbirtsev asimbirt...@gmail.com wrote:
 Hi,

 I am trying to extend newNodeComponent on a LinkTree to make nodes
 DownLoadLink.

 tree = new LinkTree(tree, createTreeModel()){

 private static final long serialVersionUID = 1L;

 @Override
             protected Component newNodeComponent( String id, IModel model )
 {
                     return new LinkIconPanel( id, model, this ) {

                        private static final long serialVersionUID = 1L;

 @Override
                             protected Component newContentComponent( String
 componentId, BaseTree tree, IModel model ) {
                                     Object obj = ( ( DefaultMutableTreeNode
 )model.getObject() ).getUserObject();
                                     if( !obj.equals(1:subtree...,
 2:subtree..., 3:subtree...) ) {
                                     LOGGER.debug(link);
                                     return new MyPanel(componentId);
                                     }

                                     return new Label( componentId,
 model.getObject().toString() );
                             }

                     };
             }
  };
     form.add(tree);
     tree.getTreeState().collapseAll();



       public class MyPanel extends Form   {


         private static final long serialVersionUID = 1L;

         MyPanel(String id) {
         super(id);

         DownloadLink dl = new DownloadLink( id, new File(
 wat-application/images/addmore.jpg ), Example DownloadLink );
         add(dl);
         }
  }


 I copied the example from:
 http://www.wicket-library.com/wicket-examples/ajax/tree/simple.0


 But i get the following error:
 WicketMessage: Component content must be applied to a tag of type 'form',
 not 'span wicket:id=content class=content id=content21' (line 0,
 column 0)


 wicket:panel
 table class=icon-paneltrtd wicket:id=iconLinkimg wicket:id=icon
 class=icon//tdtd class=contenta wicket:id=contentLinkspan
 wicket:id=content class=content/span/a/td/tr/table
 /wicket:panel, index = 8, current = 'span wicket:id=content
 class=content' (line 19, column 144)]

 Thanks


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



Re: LinkTree and DownloadLink

2010-06-22 Thread Anna Simbirtsev
Thanks

Do you know why if I add DownloadLink directly without the panel, its
invisible?

On Tue, Jun 22, 2010 at 2:55 PM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 Your MyPanel extends Form and Form should be applied to form tag not
 span tag.

 Ernesto

 On Tue, Jun 22, 2010 at 7:50 PM, Anna Simbirtsev asimbirt...@gmail.com
 wrote:
  Hi,
 
  I am trying to extend newNodeComponent on a LinkTree to make nodes
  DownLoadLink.
 
  tree = new LinkTree(tree, createTreeModel()){
 
  private static final long serialVersionUID = 1L;
 
  @Override
  protected Component newNodeComponent( String id, IModel model
 )
  {
  return new LinkIconPanel( id, model, this ) {
 
 private static final long serialVersionUID = 1L;
 
  @Override
  protected Component newContentComponent(
 String
  componentId, BaseTree tree, IModel model ) {
  Object obj = ( (
 DefaultMutableTreeNode
  )model.getObject() ).getUserObject();
  if( !obj.equals(1:subtree...,
  2:subtree..., 3:subtree...) ) {
  LOGGER.debug(link);
  return new MyPanel(componentId);
  }
 
  return new Label( componentId,
  model.getObject().toString() );
  }
 
  };
  }
   };
  form.add(tree);
  tree.getTreeState().collapseAll();
 
 
 
public class MyPanel extends Form   {
 
 
  private static final long serialVersionUID = 1L;
 
  MyPanel(String id) {
  super(id);
 
  DownloadLink dl = new DownloadLink( id, new File(
  wat-application/images/addmore.jpg ), Example DownloadLink );
  add(dl);
  }
   }
 
 
  I copied the example from:
  http://www.wicket-library.com/wicket-examples/ajax/tree/simple.0
 
 
  But i get the following error:
  WicketMessage: Component content must be applied to a tag of type 'form',
  not 'span wicket:id=content class=content id=content21' (line 0,
  column 0)
 
 
  wicket:panel
  table class=icon-paneltrtd wicket:id=iconLinkimg
 wicket:id=icon
  class=icon//tdtd class=contenta wicket:id=contentLinkspan
  wicket:id=content class=content/span/a/td/tr/table
  /wicket:panel, index = 8, current = 'span wicket:id=content
  class=content' (line 19, column 144)]
 
  Thanks
 

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




-- 
Anna Simbirtsev
(416) 729-7331


Re: LinkTree and DownloadLink

2010-06-22 Thread Ernesto Reinaldo Barreiro
Not sure but I think if you put Link on a span you will have a
generated markup span onclick=/span which might not be visible.
Why don't you use a panel like following?

wicket:panel
   a wicket:id=downloadspan wicket:id=text/span/a
/wicket:panel

Ernesto


On Tue, Jun 22, 2010 at 9:09 PM, Anna Simbirtsev asimbirt...@gmail.com wrote:
 Thanks

 Do you know why if I add DownloadLink directly without the panel, its
 invisible?

 On Tue, Jun 22, 2010 at 2:55 PM, Ernesto Reinaldo Barreiro 
 reier...@gmail.com wrote:

 Your MyPanel extends Form and Form should be applied to form tag not
 span tag.

 Ernesto

 On Tue, Jun 22, 2010 at 7:50 PM, Anna Simbirtsev asimbirt...@gmail.com
 wrote:
  Hi,
 
  I am trying to extend newNodeComponent on a LinkTree to make nodes
  DownLoadLink.
 
  tree = new LinkTree(tree, createTreeModel()){
 
  private static final long serialVersionUID = 1L;
 
  @Override
              protected Component newNodeComponent( String id, IModel model
 )
  {
                      return new LinkIconPanel( id, model, this ) {
 
                         private static final long serialVersionUID = 1L;
 
  @Override
                              protected Component newContentComponent(
 String
  componentId, BaseTree tree, IModel model ) {
                                      Object obj = ( (
 DefaultMutableTreeNode
  )model.getObject() ).getUserObject();
                                      if( !obj.equals(1:subtree...,
  2:subtree..., 3:subtree...) ) {
                                      LOGGER.debug(link);
                                      return new MyPanel(componentId);
                                      }
 
                                      return new Label( componentId,
  model.getObject().toString() );
                              }
 
                      };
              }
   };
      form.add(tree);
      tree.getTreeState().collapseAll();
 
 
 
        public class MyPanel extends Form   {
 
 
          private static final long serialVersionUID = 1L;
 
          MyPanel(String id) {
          super(id);
 
          DownloadLink dl = new DownloadLink( id, new File(
  wat-application/images/addmore.jpg ), Example DownloadLink );
          add(dl);
          }
   }
 
 
  I copied the example from:
  http://www.wicket-library.com/wicket-examples/ajax/tree/simple.0
 
 
  But i get the following error:
  WicketMessage: Component content must be applied to a tag of type 'form',
  not 'span wicket:id=content class=content id=content21' (line 0,
  column 0)
 
 
  wicket:panel
  table class=icon-paneltrtd wicket:id=iconLinkimg
 wicket:id=icon
  class=icon//tdtd class=contenta wicket:id=contentLinkspan
  wicket:id=content class=content/span/a/td/tr/table
  /wicket:panel, index = 8, current = 'span wicket:id=content
  class=content' (line 19, column 144)]
 
  Thanks
 

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




 --
 Anna Simbirtsev
 (416) 729-7331


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



Re: LinkTree and DownloadLink

2010-06-22 Thread Anna Simbirtsev
I think the problem is in this: DownloadLink dl = new DownloadLink( id, new
File( wat-application/images/addmore.jpg ), Example DownloadLink );

This does not produce any output.

On Tue, Jun 22, 2010 at 4:18 PM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 Not sure but I think if you put Link on a span you will have a
 generated markup span onclick=/span which might not be visible.
 Why don't you use a panel like following?

 wicket:panel
   a wicket:id=downloadspan wicket:id=text/span/a
 /wicket:panel

 Ernesto


 On Tue, Jun 22, 2010 at 9:09 PM, Anna Simbirtsev asimbirt...@gmail.com
 wrote:
  Thanks
 
  Do you know why if I add DownloadLink directly without the panel, its
  invisible?
 
  On Tue, Jun 22, 2010 at 2:55 PM, Ernesto Reinaldo Barreiro 
  reier...@gmail.com wrote:
 
  Your MyPanel extends Form and Form should be applied to form tag not
  span tag.
 
  Ernesto
 
  On Tue, Jun 22, 2010 at 7:50 PM, Anna Simbirtsev asimbirt...@gmail.com
 
  wrote:
   Hi,
  
   I am trying to extend newNodeComponent on a LinkTree to make nodes
   DownLoadLink.
  
   tree = new LinkTree(tree, createTreeModel()){
  
   private static final long serialVersionUID = 1L;
  
   @Override
   protected Component newNodeComponent( String id, IModel
 model
  )
   {
   return new LinkIconPanel( id, model, this ) {
  
  private static final long serialVersionUID =
 1L;
  
   @Override
   protected Component newContentComponent(
  String
   componentId, BaseTree tree, IModel model ) {
   Object obj = ( (
  DefaultMutableTreeNode
   )model.getObject() ).getUserObject();
   if( !obj.equals(1:subtree...,
   2:subtree..., 3:subtree...) ) {
   LOGGER.debug(link);
   return new MyPanel(componentId);
   }
  
   return new Label( componentId,
   model.getObject().toString() );
   }
  
   };
   }
};
   form.add(tree);
   tree.getTreeState().collapseAll();
  
  
  
 public class MyPanel extends Form   {
  
  
   private static final long serialVersionUID = 1L;
  
   MyPanel(String id) {
   super(id);
  
   DownloadLink dl = new DownloadLink( id, new File(
   wat-application/images/addmore.jpg ), Example DownloadLink );
   add(dl);
   }
}
  
  
   I copied the example from:
   http://www.wicket-library.com/wicket-examples/ajax/tree/simple.0
  
  
   But i get the following error:
   WicketMessage: Component content must be applied to a tag of type
 'form',
   not 'span wicket:id=content class=content id=content21' (line
 0,
   column 0)
  
  
   wicket:panel
   table class=icon-paneltrtd wicket:id=iconLinkimg
  wicket:id=icon
   class=icon//tdtd class=contenta
 wicket:id=contentLinkspan
   wicket:id=content class=content/span/a/td/tr/table
   /wicket:panel, index = 8, current = 'span wicket:id=content
   class=content' (line 19, column 144)]
  
   Thanks
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
  --
  Anna Simbirtsev
  (416) 729-7331
 

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




-- 
Anna Simbirtsev
(416) 729-7331