function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
benwrigleybenwrigley 

Binding Output text params

Hi There,

 

Anyone know if this should work?

 

 

    <apex:column style="font-weight:bold" headerValue="Sites" width="320px" rendered="{!RequireSites}">
        <apex:outputText value="{!SiteAbbreviations}">
            <apex:param name="pbid" value="{!pb.ID}" assignTo="{!SiteAbbreviations}"/>
        </apex:outputText>
     </apex:column>

 I would expect the param to call the method setSiteAbbreviations(String pbid) in the controller

 

And the getSiteAbbreviations() to get back the value of what we set in the set method.

 

The get works fine, but the set never gets called. 

 

Can you bind params of outputText to controller variables?

 

TIA

 

John De SantiagoJohn De Santiago

You shouldn't need to use a param tag in this scenario. The output text field should take care of reading and writing to the parameter.

 

You might try creating an actual property rather than using getters and setters and see if you get better results.

 

Example:

 

public string SiteAbbreviations {get;set;}

 

You can use the above syntax to create a class level property and bind your output text to this property just like you already have it. 

 

Example:

 

<apex:outputText value="{!SiteAbbreviations}"/>

 

benwrigleybenwrigley

Hi John,

 

The thing is, I want to pass the value of { !pb.ID}  back to the controller, which will do something with the value in the background and return the new value when the get is called.

 

What is the best way to get a VF Page to send a value to the controller and get a response to display? But this needs to happen on the page load, not as part of an action.

 

Any thoughts?