• YV
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 5
    Replies
My code is here


<apex:component controller="Type_Ahead_Component_Controller" >
     <apex:stylesheet value="{!URLFOR($Resource.AutoComplete,'/jquery-ui.css')}"/>
     <apex:includeScript value="{!URLFOR($Resource.AutoComplete,'/jquery-1.12.4.js')}"/>
     <apex:includeScript value="{!URLFOR($Resource.AutoComplete,'/jquery-ui.js')}"/>

     <apex:attribute name="sObj" type="String" description="sobject name"></apex:attribute>
     <apex:attribute name="fields" type="String" description="SObject field name"></apex:attribute>
     <apex:attribute name="index" type="string" description="SObject name as index" assignTo="{!objectName}" />

     <apex:pageBlock >
          <apex:pageBlockSection collapsible="false" title="{!objectName}">
               <input  id="{!index}objectSearch" value="{!searchTerm}"/>    
          </apex:pageBlockSection>
     </apex:pageBlock>
    
    <apex:outputPanel id="outerPanel"> 
        <apex:outputPanel id="innerPanel">
            <apex:pageBlock title="{!objectName} detail">
                <apex:pageBlockTable value="{!sobjectWrapper}" var="item" id="recordID">
                    <apex:outputField value="{item.name}" />
                </apex:pageBlockTable>
                <apex:pageBlockButtons location="Top">
                    <apex:commandButton value="Save" />
                </apex:pageBlockButtons>
            </apex:pageBlock>
        </apex:outputPanel>
    </apex:outputPanel>
     <!--apex:pageBlock title="{!objectName} detail" rendered="true" id="recordID">
         <apex:pageBlockTable value="{!sobjectWrapper}" var="item">
             <apex:outputField value="{item.name}" />
         </apex:pageBlockTable>
         <apex:pageBlockButtons location="Top">
             <apex:commandButton value="Save" />
         </apex:pageBlockButtons>
     </apex:pageBlock-->

     <apex:actionFunction name="showObjectInfo" action="{!showObjectDetail}"     reRender="outerPanel,innerPanel,recordID">  
          <apex:param assignTo="{!selectedObjectID}" name="selectedObjectID" value=""/> 
          <apex:param assignTo="{!tempFields}"  name="field" value="" />
          <apex:param assignTo="{!objectName}" name="objectName" value="" />
     </apex:actionFunction>
</apex:component>

Please provide me any solution
Thank you in advance
  • August 12, 2021
  • Like
  • 0
this is my controller code

public void returnSelectedFields() {   // show selected fields from availabel list to selected list
        System.debug('selcted size in controller :'+selected.size());
        if(selectedFieldOptions == null){
            selectedFieldOptions = new list<SelectOption>();// selected fields in this list
        } 
        Set<String> selectedFieldSet = new Set<String>(selected);       // getting selected fields into string set to remove 
        for(String str : selectedFieldSet) {
            for(integer j = 0; j<availableFieldOptions.size(); j++) {
                if(str == availableFieldOptions[j].getvalue()) {
                    selectedFieldOptions.add(new selectOption(availableFieldOptions[j].getvalue(), availableFieldOptions[j].getLabel()));
                    availableFieldOptions.remove(j);
                }
            }
        }
        if(availableFieldOptions.size()==0) {
            addHide = true; 
        }
        if(selectedFieldOptions.size() > 0) {
            removeHide = false;
            processHide = false;
        }
        selectedFieldOptions.sort();
        availableFieldOptions.sort();
    }
    public void removeSelectedFields() {   // for remove selected fields from second picklist and add them into to second pikclist
        Set<String> removeFieldSet = new Set<String>(remove);   // getting selected fields into string set to remove 
        for(String str : removeFieldSet) {  // removing fields from selected fields
            for(integer j = 0; j<selectedFieldOptions.size(); j++) {
                if(str == selectedFieldOptions[j].getvalue()){
                    availableFieldOptions.add(new SelectOption(selectedFieldOptions[j].getvalue(), selectedFieldOptions[j].getLabel()));
                    selectedFieldOptions.remove(j);
                }
            }
        }
        if(selectedFieldOptions.size() != 0) {
            removeHide = false;
            processHide = false;
        }
        else {
            removeHide = true;
            processHide = true;
        }
        if(availableFieldOptions.size() > 0) {
            addHide = false;
        }
        availableFieldOptions.sort();
        System.debug('availableFieldOptions size in remove methods : '+availableFieldOptions.size());
        System.debug('selectedFieldOptions size remove methods  : '+selectedFieldOptions.size());
    }


Thank you 
YV
  • July 17, 2021
  • Like
  • 0
visualforce component code
I am stuck here 
in this code i am not able to update child check box state in apex controller

Please help me
Thank you

User-added image
User-added image
  • July 14, 2021
  • Like
  • 0
Hi folks,
I am working on a assignment (using visualforce component) where i need to work on more than 15000 thousands records and need full pagination without using standardSetcontroller, offset and limits,
Please help me,

Thanks
yagya
  • July 04, 2021
  • Like
  • 0
  1.  I created a Visualforce page and added standard controller position__c object. There are some required fields like name,min_pay and max_pay. Min and max pay both have validation rule to check the minimum value criteria.  Without entering value in input text on visualforce page on those fields why i am able to save records.
This is my visualforce page code

<apex:page standardController="Position__c">
    <apex:form>
        <apex:pageMessages/>
        <apex:pageBlock title="Position"> 
            <apex:pageBlockButtons>
                <apex:commandButton action="{!save}" value="save"/>
                <apex:commandButton action="{Cancel}" value="Cancel"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Create records">
                <apex:inputText value="{!position__c.name}" />
                <apex:inputText value="{!position__c.min_pay__c}" />
                <apex:inputText value="{!position__c.max_pay__c}" />
                <apex:inputText value="{!position__c.status__c}" />
                <apex:inputText value="{!position__c.job_description__c}" />
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

User-added image

if i edit this page and save without do anything it will also accept values and will take $0.0 value in min and max pay fields

Please help me
Thank you in advance 
  • June 11, 2021
  • Like
  • 0
My code is here


<apex:component controller="Type_Ahead_Component_Controller" >
     <apex:stylesheet value="{!URLFOR($Resource.AutoComplete,'/jquery-ui.css')}"/>
     <apex:includeScript value="{!URLFOR($Resource.AutoComplete,'/jquery-1.12.4.js')}"/>
     <apex:includeScript value="{!URLFOR($Resource.AutoComplete,'/jquery-ui.js')}"/>

     <apex:attribute name="sObj" type="String" description="sobject name"></apex:attribute>
     <apex:attribute name="fields" type="String" description="SObject field name"></apex:attribute>
     <apex:attribute name="index" type="string" description="SObject name as index" assignTo="{!objectName}" />

     <apex:pageBlock >
          <apex:pageBlockSection collapsible="false" title="{!objectName}">
               <input  id="{!index}objectSearch" value="{!searchTerm}"/>    
          </apex:pageBlockSection>
     </apex:pageBlock>
    
    <apex:outputPanel id="outerPanel"> 
        <apex:outputPanel id="innerPanel">
            <apex:pageBlock title="{!objectName} detail">
                <apex:pageBlockTable value="{!sobjectWrapper}" var="item" id="recordID">
                    <apex:outputField value="{item.name}" />
                </apex:pageBlockTable>
                <apex:pageBlockButtons location="Top">
                    <apex:commandButton value="Save" />
                </apex:pageBlockButtons>
            </apex:pageBlock>
        </apex:outputPanel>
    </apex:outputPanel>
     <!--apex:pageBlock title="{!objectName} detail" rendered="true" id="recordID">
         <apex:pageBlockTable value="{!sobjectWrapper}" var="item">
             <apex:outputField value="{item.name}" />
         </apex:pageBlockTable>
         <apex:pageBlockButtons location="Top">
             <apex:commandButton value="Save" />
         </apex:pageBlockButtons>
     </apex:pageBlock-->

     <apex:actionFunction name="showObjectInfo" action="{!showObjectDetail}"     reRender="outerPanel,innerPanel,recordID">  
          <apex:param assignTo="{!selectedObjectID}" name="selectedObjectID" value=""/> 
          <apex:param assignTo="{!tempFields}"  name="field" value="" />
          <apex:param assignTo="{!objectName}" name="objectName" value="" />
     </apex:actionFunction>
</apex:component>

Please provide me any solution
Thank you in advance
  • August 12, 2021
  • Like
  • 0
Hi folks,
I am working on a assignment (using visualforce component) where i need to work on more than 15000 thousands records and need full pagination without using standardSetcontroller, offset and limits,
Please help me,

Thanks
yagya
  • July 04, 2021
  • Like
  • 0
  1.  I created a Visualforce page and added standard controller position__c object. There are some required fields like name,min_pay and max_pay. Min and max pay both have validation rule to check the minimum value criteria.  Without entering value in input text on visualforce page on those fields why i am able to save records.
This is my visualforce page code

<apex:page standardController="Position__c">
    <apex:form>
        <apex:pageMessages/>
        <apex:pageBlock title="Position"> 
            <apex:pageBlockButtons>
                <apex:commandButton action="{!save}" value="save"/>
                <apex:commandButton action="{Cancel}" value="Cancel"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Create records">
                <apex:inputText value="{!position__c.name}" />
                <apex:inputText value="{!position__c.min_pay__c}" />
                <apex:inputText value="{!position__c.max_pay__c}" />
                <apex:inputText value="{!position__c.status__c}" />
                <apex:inputText value="{!position__c.job_description__c}" />
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

User-added image

if i edit this page and save without do anything it will also accept values and will take $0.0 value in min and max pay fields

Please help me
Thank you in advance 
  • June 11, 2021
  • Like
  • 0