on 01-06-2009 11:39 AM
Hi all,
what i want is to assign a picture of car to the brand of picture.like in the drop down if a person select hyundai thena picture of hyundai brand car should get displayed.
any help will be appricated.
thanks.
Hi
create value node (image)
create value attributes imgalt
imgsource
define action and assign that action to Dropdown
on implemnetation of method onaction()
string img=wdcontext.node().currentnodeelement().getcartype(); //dropdown value
wdcontext.nodeimage().currentimageelement().setimgalt(img+".gif");
wdcontext.nodeimage().currentimageelement().setimgsource(img+".gif");
i hope this will work.
Thanks and Regards,
Tulasi Palnati
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried the same code but i am not able to understand where i am going to define that image1 is for maruti image2 is for alto image3 is for bmw, and when i select alto from drop down it will only select the corresponding image2.where should i do the linking between the images and the names of cars in the drop down list.
Hi Rashami
insted of having image names like image1, image2,.... you can give image names like maruti, bmw, .... so whatever value you are getting from dropdown you can just concat it with .gif or whatever extention of the image and it will work
e. g.
when you select "Maruti" in drop down you will get it in img variable from bellow line
string img=wdcontext.node().currentnodeelement().getcartype();
Now there will be a image named as Maruti.gif so in bellow line you will get the perfect image name "Maruti.gif"
String imgName = img+".gif";
And then you assign this image name to the image node
wdcontext.nodeimage().currentimageelement().setimgalt(imgName);
wdcontext.nodeimage().currentimageelement().setimgsource(imgName);
Ninad
Drop-down lists don't support icons. As an alternative, you could open a popup window or use a Menu UI element.
Or do you just want to display an image that corresponds to the current selection of the drop-down list? To do so, assign an action to the onSelect event and change the image source of some Image UI element according to the selection.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create a action say "onSelect" and bound this action to the onSelect property of thr drop down.
when the user selects the Hyundai , show the image of the car.
have all the images in the component mimes folder and create a context attribute of type String .
bound this attribute to the source property of the image ui element.
in the Action method :
get the current selected element and based on the condition set the path of the image to the attribute .
(if hyundai is selected , set the image path to the context attribute).
Thanks and regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Have a workaround like,,,
Set the source property of Image UI to Context Attribute and check the dropdown element and then set the image context attribute like
if(wdContext.CurrentDropdownelement.getAttr()=="MARUTHI")
{
IprivateView.Imageelement ele = wdContext.nodeImage().createImageelement();
ele.setImageAttri(" ......");
wdContext.nodeImage().bind(ele);
}
Regards
Raghu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.