Hey Koen,
On Fri, Dec 20, 2013 at 11:38 AM, Koen Deforche <k...@emweb.be> wrote:
> Hey Raphael,
>
> Tooltips are indeed only plain text. You want to have an XHTML tooltip
> instead?
>
Yes, that could make it. I'm looking to get something like this:
http://www.dyn-web.com/code/tooltips/image_text.php
>
> As to your image:
>
> a.setData(WLink.new("http://host.com/thumbnail.jpg"),ItemDataRole::DecorationRole
> )
>
> (the model shouldn't contain widgets, since that's not a proper separation
> of model and view).
>
I see, but how do I display an image in a cell then? In my example,
values[0] is a product id, but I don't want to display the product id of
course, and I would like to display an image for the product, the URL of
which I can build with the product id. Any idea? Knowing both tooltip and
image in TableView would be helpful
Thanks!
raph
>
> Regards,
> koen
>
>
>
> 2013/12/19 Raphael Bauduin <rbli...@gmail.com>
>
>> Hi,
>>
>> I'm trying to display images in WTableView cells, as well as in tooltips
>> of these cells, but I'm not getting it working.
>>
>> Here is the code with which I build my model (JRuby code using JWt):
>>
>> @data.each_index do |row_index|
>> row=@data[row_index] #row_index was used in another try, kept it
>> here though not used below
>> values = row.values
>>
>> a = WStandardItem.new
>> a.setData(values[0].to_i,ItemDataRole::UserRole+1 )
>>
>> a.setData(WImage.new(WLink.new("http://host.com/thumbnail.jpg")),ItemDataRole::DecorationRole
>> )
>>
>> b = WStandardItem.new
>> b.setData(values[1].to_s,ItemDataRole::UserRole+1 )
>> b.setData(values[1].to_s,ItemDataRole::DisplayRole )
>>
>> @model.appendRow([ a, b])
>> end
>>
>>
>> I've tried with ItemDataRole::ToolTipTole, but it seems to only handle
>> text.
>> Any advice on a better way of building the model is also welcome. my
>> approach seems very verbose.
>>
>> Thanks
>>
>> Raph
>>
>>
>> ------------------------------------------------------------------------------
>> Rapidly troubleshoot problems before they affect your business. Most IT
>> organizations don't have a clear picture of how application performance
>> affects their revenue. With AppDynamics, you get 100% visibility into your
>> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics
>> Pro!
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
>> _______________________________________________
>> witty-interest mailing list
>> witty-interest@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/witty-interest
>>
>>
>
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics
> Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
> _______________________________________________
> witty-interest mailing list
> witty-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>
--
Web database: http://www.myowndb.com
Free Software Developers Meeting: http://www.fosdem.org
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest