Hello All,
I want to configure a Node Icon in DbtreeView .
Here is my part of code
var first_bind = elements.bean_rec_nav.createBinding( globals.CONST_DATABASE_SERVER, firstbinding);
first_bind.setImageMediaDataprovider(data_prov)
data_prov is a provider and its a media type and has an image in it .But when i run it the Dbtrrview does not change the icon .
I checked out forum and found this
You have to provide the image in a calculation or data column
I dont know what calculation is and how it can be achived .
Would really appreciate your help.
Thank you
You need to give it the name of the dataprovider, not the value, which is what you are giving it now.
So if your database column is data_prov, change your code to:
first_bind.setImageMediaDataprovider("data_prov");
And this should work!
Hello ,
Patrick Thanks for the Reply , i learned a lot from ur previous posts so thanks about that too.
first_bind.setImageMediaDataprovider(“data_prov”);
I tried it that way but it did not work . Its still not changing the icons of the node.
I also tried to create a calculation .
Here is my function
function icons()
{
return “media:///check.png”;
}
and here is my call
var first_bind = elements.bean_rec_nav.createBinding( globals.CONST_DATABASE_SERVER, firstbinding);
first_bind.setImageURLDataprovider(“icons”);
I am not able to understand why its not working .Do we have some constraints on the Size of Image .
I just did a quick try in 5.1.4 and it works for me using a dataprovider’s name and the following syntax:
first_bind.setImageMediaDataprovider("data_prov");
Just make sure that your field is a blob and has images into it of type jpeg/png/gif.
I don’t know about any size limitations but the bean will not scale the images for you that’s for sure, so you better have icons in there…
Just make sure that your field is a blob
Real Newbie Question : Do you mean to say make sure its media type feild .
But i dont understand the logic , there is some small thing i am missing and would appreciate your help .
This is what i think , instead of trying to replace an image are we trying to overlay an image on top of the image of dbtreeview .
How am i doing it :
I have image in media , its a png .
now when i try to Load the image i go to my icons function in my calculations and tell them where image is (i dont know why i need to do that , why cant i do it directly)
and then you said my feild is blob , so when i go to my form and just create a feild from my selected records which shows icons in it and try to display it in media type feild its perfect it shows me an image ,
but when i try to set it up on my icons in dbtree view its not working out .
You must have an image in the image (blob) field of the table you are using for the tree bean if you are using setImageMediaDataprovider().
This way, each record needs his own image and no, it will not overlay, but replace the tree default icons.
If you are using setImageURLDataprovider() though, then you can use a global of type String which will contain “media:///yourmedia.png”, but then all your nodes will have the same image.
I’m sorry but I don’t understand what is not working for you.
If you are using setImageURLDataprovider() though, then you can use a global of type String which will contain “media:///yourmedia.png”, but then all your nodes will have the same image.
This worked . Thanks a Lot , but i will for sure try to figure out where was i going wrong on previous ones .Thanks for your Help really appreciate it .