Re: TreeTabel and file download

2011-02-23 Thread Anton Bessonov

Hello Martin,

thanks for your reply! You mean override newLink method in 
DefaultAbstractTree?



See DownloadLink.

On Fri, Dec 31, 2010 at 3:19 AM, Anton Bessonovexe...@googlemail.comwrote:


Hello list,

I'm trying to implement small file browser and I use TreeTable.
PropertyTreeColumn shows file names and I can get (newCell -
getTreeTable().getTreeState().isNodeSelected(node)) java.io.File. Now, I'm
need force to download file after click on the file name. Any suggestions?

Thanks,

Anton

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





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



Re: TreeTabel and file download

2011-02-23 Thread Martin Grigorov
On Wed, Feb 23, 2011 at 8:01 PM, Anton Bessonov exe...@googlemail.comwrote:

 Hello Martin,

 thanks for your reply! You mean override newLink method in
 DefaultAbstractTree?

 No, Probably you'll have to create custom TreeColumn that uses DownloadLink
instead of Label (as PropertyTreeColumn does).


  See DownloadLink.

 On Fri, Dec 31, 2010 at 3:19 AM, Anton Bessonovexe...@googlemail.com
 wrote:

  Hello list,

 I'm trying to implement small file browser and I use TreeTable.
 PropertyTreeColumn shows file names and I can get (newCell -
 getTreeTable().getTreeState().isNodeSelected(node)) java.io.File. Now,
 I'm
 need force to download file after click on the file name. Any
 suggestions?

 Thanks,

 Anton

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




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




Re: TreeTabel and file download

2011-01-01 Thread Martin Grigorov
See DownloadLink.

On Fri, Dec 31, 2010 at 3:19 AM, Anton Bessonov exe...@googlemail.comwrote:

 Hello list,

 I'm trying to implement small file browser and I use TreeTable.
 PropertyTreeColumn shows file names and I can get (newCell -
 getTreeTable().getTreeState().isNodeSelected(node)) java.io.File. Now, I'm
 need force to download file after click on the file name. Any suggestions?

 Thanks,

 Anton

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




Re: TreeTabel and file download

2010-12-31 Thread Anton Bessonov

I solved it.

new PropertyTreeColumn(new 
ColumnLocation(Alignment.MIDDLE, 8, Unit.PROPORTIONAL),

, userObject.name) {
@Override
public IRenderable newCell(TreeNode node, int level)
{
if 
(getTreeTable().getTreeState().isNodeSelected(node)) {
File f = new PropertyModelFile(node, 
userObject.file).getObject();
ResourceStreamRequestTarget res = new 
ResourceStreamRequestTarget(

new FileResourceStream(f), f.getName());
getRequestCycle().setRequestTarget(res);
return null;
} else {
return super.newCell(node, level);
}
}
}

and

TreeTable tree = new TreeTable(treeTable, createTreeModel(), columns);
tree.setLinkType(TreeTable.LinkType.REGULAR);

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



TreeTabel and file download

2010-12-30 Thread Anton Bessonov

Hello list,

I'm trying to implement small file browser and I use TreeTable. 
PropertyTreeColumn shows file names and I can get (newCell - 
getTreeTable().getTreeState().isNodeSelected(node)) java.io.File. Now, 
I'm need force to download file after click on the file name. Any 
suggestions?


Thanks,

Anton

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