1
Your code basically works - one issue might be the way in which you are selecting the input element. If anything changes on the page the id - "j_id0:j_id2:j_id4:j_id31:j_id34:j_id35", will also change since this describes the elements position in relation to other page elements.
Personally I normally solve this by explicitly adding an id:
<apex:...
1
You don't need to query the records, just bind directly to the record in the controller:
<apex:page standardController="Opportunity" extensions="Opportunity_UpdExt" docType="html-5.0" sidebar="true" lightningstylesheets="true">
<apex:form>
<apex:pageBlock>
<apex:...
1
Inside Constructor, A local variable is declared with the same name as an instance variable. Instead, directly populate the instance variable. It fixed my issue.
Only top voted, non community-wiki answers of a minimum length are eligible
Related Tags
visualforce-component × 1099visualforce × 728
apex × 506
dynamic-visualforce × 88
javascript × 65
email-template × 60
controller × 50
lightning-aura-components × 39
community × 31
custom-controller × 24
rerender × 23
lightning × 21
jquery × 18
visualforce-template × 17
trigger × 16
html × 15
dynamic-vf-component × 15
controller-extension × 14
managed-package × 12
salesforce1-app × 12
css × 12
page-layout × 11
home-page-component × 11
email × 10
custom-object × 10