function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Hi anyone guess Can i create a dynamic field in apex at run time . if yes then how it's Possible?
Hi,
Try the below code snippet as reference:
--------------- Vf page------------- <apex:page controller="examples15" >
<apex:form >
<table>
<tr>
<td><apex:dynamicComponent componentValue="{!outtext}" />
</td>
<td><apex:dynamicComponent componentValue="{!cmdbutton}"/><Br/>
</tr>
<td><apex:dynamicComponent componentValue="{!intext}"/>
<td><apex:inputText disabled="true" />
</table>
</apex:form>
</apex:page>
---------------- Apex Controller ----------------------
public class examples15
{
public Component.Apex.OutputText getOuttext()
Component.Apex.OutputText outText = new Component.Apex.OutputText();
outText.value = 'Some dynamic output text.';
return outText;
}
public Component.Apex.InputText getintext()
Component.Apex.InputText inText = new Component.Apex.InputText();
inText.value = 'Some dynamic output text.';
inText.size = 50;
inText.style='width:200px';
inText.style='height:50px';
inText.disabled=false;
return inText;
public Component.Apex.CommandButton getcmdbutton()
Component.Apex.CommandButton cmdbutton = new Component.Apex.CommandButton();
cmdbutton.value = 'Click';
return cmdbutton;
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
Good Answers thanks i think it 's new concepts.
Hi,
Try the below code snippet as reference:
--------------- Vf page------------- <apex:page controller="examples15" >
<apex:form >
<table>
<tr>
<td><apex:dynamicComponent componentValue="{!outtext}" />
</td>
<td><apex:dynamicComponent componentValue="{!cmdbutton}"/><Br/>
</td>
</tr>
<tr>
<td><apex:dynamicComponent componentValue="{!intext}"/>
</td>
<td><apex:inputText disabled="true" />
</td>
</tr>
</table>
</apex:form>
</apex:page>
---------------- Apex Controller ----------------------
public class examples15
{
public Component.Apex.OutputText getOuttext()
{
Component.Apex.OutputText outText = new Component.Apex.OutputText();
outText.value = 'Some dynamic output text.';
return outText;
}
public Component.Apex.InputText getintext()
{
Component.Apex.InputText inText = new Component.Apex.InputText();
inText.value = 'Some dynamic output text.';
inText.size = 50;
inText.style='width:200px';
inText.style='height:50px';
inText.disabled=false;
return inText;
}
public Component.Apex.CommandButton getcmdbutton()
{
Component.Apex.CommandButton cmdbutton = new Component.Apex.CommandButton();
cmdbutton.value = 'Click';
return cmdbutton;
}
}
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
All Answers
Hi,
Try the below code snippet as reference:
--------------- Vf page------------- <apex:page controller="examples15" >
<apex:form >
<table>
<tr>
<td><apex:dynamicComponent componentValue="{!outtext}" />
</td>
<td><apex:dynamicComponent componentValue="{!cmdbutton}"/><Br/>
</td>
</tr>
<tr>
<td><apex:dynamicComponent componentValue="{!intext}"/>
</td>
<td><apex:inputText disabled="true" />
</td>
</tr>
</table>
</apex:form>
</apex:page>
---------------- Apex Controller ----------------------
public class examples15
{
public Component.Apex.OutputText getOuttext()
{
Component.Apex.OutputText outText = new Component.Apex.OutputText();
outText.value = 'Some dynamic output text.';
return outText;
}
public Component.Apex.InputText getintext()
{
Component.Apex.InputText inText = new Component.Apex.InputText();
inText.value = 'Some dynamic output text.';
inText.size = 50;
inText.style='width:200px';
inText.style='height:50px';
inText.disabled=false;
return inText;
}
public Component.Apex.CommandButton getcmdbutton()
{
Component.Apex.CommandButton cmdbutton = new Component.Apex.CommandButton();
cmdbutton.value = 'Click';
return cmdbutton;
}
}
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
Good Answers thanks i think it 's new concepts.