0

I would like to know how to get an attribute of a component in a visualForce code.

In this code, wrappers is a map and I would like to put the value of the pageBlocktable to a List which is contained in my map, it is accessible by the key "cable". Unfortunately, when I try to hardcode the value I want in the get function with a string, I have an error.

I have tried to replace what is is the circle pointed by the arrow with :

Cable
"Cable"
'Cable'
\"Cable\"
\'Cable\'

But none of them seem function, so I tried to get it by putting in a title and acces it later.

I also dont think it is possible to use the apex:param to set the variable of my controller and reference it.

Can someone help me getting the right synthax or tell me how to achieve what I am trying to do?

thanks

visualForce code

1
  • 1
    welcome to SFSE! Please see How to Ask on getting the most from the Community. Please don't use screen shots - instead, edit and paste your VF markup (minimum set) and format using the toolbar
    – cropredy
    Commented Jun 3, 2022 at 23:25

1 Answer 1

0

You can't reference a component's attributes that way in Visualforce. You can only reference public Apex variables and methods, and Visualforce variables (e.g. from apex:pageBlockTable or apex:variable). As an aside, you only use ! at the beginning of a merge field, and you don't use .get on a Map, but just the ordinary map[key] notation. {wrappers[test.title]} would have been the appropriate way to reference the value, if it were allowed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .