Yes I know, But i want to know how can I set parameter / call the setter of the apex property in VISUALFORCE? I have an visualforce page and want to set parameter.
One way is as Harsha told you a above. Other way to do this is by passing a value as a param in your actionfunction. <apex:param> has a "assignTo" attribute, which lets you assign the specified value to a property in the controller.
I have a class defined: public with sharing class ScheduleSlotControllerApx
with a property public string DPSURL{get; set;}
in the visual force page it is mapped to <apex:form id="cciForm0"> <apex:inputText label="DSP URL" value="{!DPSURL}" id="DPSURL"/> </apex:form>
then i have a button that calls a FetchScheduleSlotInfo method, in another form <apex:form id="cciForm"> <!-- The rerender attribute causes addressList to be re-rendered when the button is clicked --> <apex:commandButton action="{!ViewScheduleSlotInfo}" value="Load Schedule Slots!" rerender="cciForm" status="callZipAPIStatus"> </apex:commandButton> </apex:form>
in the code i have line of code System.debug('setPropertyValues URL - ' + this.DPSURL);
to see if i'm able to get the updated value of the property.
Hi
If you mean apex properties to apex data variables, yes you can..!
The property should be public and {get;set;}
As : public String str1 {get;set;}
This means that you can set a value from controller or get it's new value from the page..!
Ok thanks,
so i want to access and modify this String object with VisualForce?!
public String objectid {get; set;}
Kind Regards
Yes..!
Yes I know, But i want to know how can I set parameter / call the setter of the apex property in VISUALFORCE? I have an visualforce page and want to set parameter.
How can I do that with VIsualforce? Which tag?
You can use <apex:inputText value="{!objectId}/> for this..!
If you initialize objectId with some value in the controller's constructor, then the same will display on the page
If you change it to any other in the page the same is reflected in the controller..!
One way is as Harsha told you a above. Other way to do this is by passing a value as a param in your actionfunction. <apex:param> has a "assignTo" attribute, which lets you assign the specified value to a property in the controller.
Example:
<apex:commandButton value="Submit" action="{!submit}" rerender="error" >
<apex:param name="anything" value="any_value" assignTo="{!any_public_property}" />
</apex:commandButton>
I have a class defined:
public with sharing class ScheduleSlotControllerApx
with a property
public string DPSURL{get; set;}
in the visual force page it is mapped to
<apex:form id="cciForm0">
<apex:inputText label="DSP URL" value="{!DPSURL}" id="DPSURL"/>
</apex:form>
then i have a button that calls a FetchScheduleSlotInfo method, in another form
<apex:form id="cciForm">
<!-- The rerender attribute causes addressList to be re-rendered when the button is clicked -->
<apex:commandButton action="{!ViewScheduleSlotInfo}" value="Load Schedule Slots!" rerender="cciForm" status="callZipAPIStatus">
</apex:commandButton>
</apex:form>
in the code i have line of code
System.debug('setPropertyValues URL - ' + this.DPSURL);
to see if i'm able to get the updated value of the property.