-
ChatterFeed
-
1Best Answers
-
0Likes Received
-
0Likes Given
-
38Questions
-
21Replies
Can I append apex elements to html with jQuery?
I have a VF page where i am displaying table rows dynamically on click of add row button. Here is the table
<table class="table table-bordered table-hover table-sortable" id="tab_logic1">
<thead>
<tr >
<th class="text-center">
Qualification
</th>
<th class="text-center">
Subject
</th>
<th class="text-center">
Grade
</th>
<th class="text-center">
Status
</th>
</tr>
</thead>
<tbody>
<tr class="tabrow" id="addr0">
<td>
<apex:inputField styleClass="qualification" value="{!profTab.Qualification__c}"/>
</td>
<td>
<apex:inputField value="{!profTab.Subject_Text__c}"/>
</td>
<td>
<input type="text" name='grade0' placeholder='Grade' class="form-control"/>
</td>
<td>
<input type="text" name='status0' placeholder='Grade' class="form-control"/>
</td>
</tr>
<tr id="addr1"></tr>
</tbody>
</table>
I am new to jquery. In my jquery code is it possible to add apex:inputField to the html append. For ex
var i=1;
$("#add_row").on("click", function() {
$('#tab_logic1').append("<tr id='addr"+i+"'><td>"+ (i+1) +"</td><td><apex:form><apex:inputField value='{!profTab.Qualification__c}'/></apex:form></td><td><input name='mail'"+i+"' type='text' placeholder='Mail' class='va20 form-control input-md'></td><td><select class='form-control slct0' name='slct'"+i+" placeholder='Select'><option value='1'>1</option><option value='2'>2</option></select></td></tr");
i++;
});
The above code gives me error saying apex:inputField must be between apex:form tag and when i add the tag the page on inspect element shows unexpected token.
I tried cloning the table row but there i was facing another issue which was that the drop down field on the cloned row doesn't function or behaves disabled.
ANy help on this is greatly appreciated.
Thanks in advance
Priya
-
- VN
- December 23, 2016
- Like
- 0
- Continue reading or reply
Page getting refreshed on close of modal window.
I have a modal window which has a few checkboxes displayed. When i select a few checkboxes and click 'ok' button i want the selected chekboxes to be displayed as tabs. But this is not happening because i believe the whole page is getting refreshed and the variable list storing the selected checkboxes is getting cleared.
How do i stop the page from getting refreshed. I tried using action function but that is not helping either.
The code for tabs display
<div class="tabbable-line tabbable-tabdrop tabbable-custom-profile" id="showcaseTabs">
<ul class="nav nav-tabs">
<li class="active">
<a href="#tabDashboard" data-toggle="tab"> Dashboard </a>
</li>
<li>
<apex:repeat value="{!selectedTabsList}" var="tabName" id="theRepeat">
<apex:outputLink > {!tabName} </apex:outputLink>
</apex:repeat>
</li>
<li>
<apex:outputLink html-data-target="#displayShowcase" html-data-toggle="modal" >
<i class="fa fa-plus"></i>
</apex:outputLink>
</li>
</ul>
</div>
The modal window code
<div id="displayShowcase" class="modal fade" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<a class="pull-right" data-dismiss="modal" aria-hidden="true">
<i class="fa fa-remove font-theme"></i>
</a>
<h4 class="modal-title font-theme">Select Tabs</h4>
</div>
<div class="modal-body">
<apex:pageBlock >
<apex:pageBlockTable value="{!showcaseTabList}" var="showCaseTab" id="table" title="All Showcases">
<apex:column >
<apex:inputCheckbox value="{!showCaseTab.selected}" id="inputId"/>
</apex:column>
<apex:column value="{!showCaseTab.recType}" />
</apex:pageBlockTable>
</apex:pageBlock>
</div>
<div class="modal-footer">
<button class="btn btn-outline btn-theme" data-dismiss="modal" aria-hidden="true">Cancel</button>
<button id="btnConfirm" class="btn btn-outline btn-theme">OK</button>
</div>
</div>
</div>
</div>
<apex:actionFunction name="chkSelectedTabs" action="{!allSelectedTabs}" rerender="showcaseTabsContainer"/>
the javascript for button click
<script src="https://code.jquery.com/jquery-3.1.0.slim.min.js"
integrity="sha256-cRpWjoSOw5KcyIOaZNo4i6fZ9tKPhYYb6i5T9RSVJG8="
crossorigin="anonymous">
</script>
<script>
$(function() {
$("#btnConfirm").on("click", function() {
chkSelectedTabs();
return false;
});
});
</script>
Please advice
-
- VN
- December 08, 2016
- Like
- 0
- Continue reading or reply
system.security.NoAccessException:
Hi All,
I am getting an error on one of VF page i developed. I am overriding the standard edit page for a custom object say A with the visualforce page. In the page i have created a drop down field by quering another custom object say C. So C is child of Custom object called B which in turn is child of A.
The drop down displays all the records from C which are related to B(related to A). I hope i am making sense.
So when i click on save for this record it gives me the error above. From my initial analysis i found that it's because the profile i am using to save the record has only read only access for the custom object C. But in my code i am no where trying to edit custom object C. I am just using it to query and create the drop down for me.
I have no idea why salesforce is assuming i am trying to update object.
Please forgive me if my query is confusing. If you need further info please let me know. Any help on this would be greatly appreciated.
Thanks in advance
Priya Nair
-
- VN
- November 15, 2011
- Like
- 0
- Continue reading or reply
Starts with Vowel Sound
Hi,
Can anyone please let me know why is this checkbox 'Starts with a vowel sound' is used while creating objects in salesforce?
I read somewhere that 'This is used for languages where words need different treatment depending on the first character'.
If anyone can explain me with example on how it works that would be great.
Thanks in advance
Priya Nair
-
- VN
- April 26, 2010
- Like
- 0
- Continue reading or reply
Connect Offline Issue
Hi All,
One of our user is facing an issue while trying to connect offline. The user has tried uninstalling and then re-installig the connect offline version. The error message says "Unknown Exception in SyncRun::Api Request. " The offline version is 2.0.
Can anyone please help me out with this
Thanks in advance
Priya
-
- VN
- December 02, 2009
- Like
- 0
- Continue reading or reply
Campign Member Import Wizard Error
Hi,
I tried to import 2780 campaign members using the import wizard and i always got an error mail.There are no invalid ids and all the contacts/leads are existing in the salesforce.When I checked the maximum number of records that can be imported at a time, it is shown as 50000. Can anyone please help me on this?
Thank you!
-
- VN
- December 01, 2009
- Like
- 0
- Continue reading or reply
Issue in VSS and Eclipse with Force.com IDE Integration
Hi,
We are facing an issue after integrating VSS and Eclipse with force.com IDE. When two different users check out a file(S-Control, Trigger…) from VSS to Eclipse working folder and after performing the changes try to check-in the file back from Eclipse working folder to VSS the eclipse gets hanged and the file doesn’t get checked-in.
Problem Description
Suppose there are two users- User A and User B.
These two users try to update two different files say - User A Check Outs Trigger A and User B check out Trigger B ,which are both under a common folder called unpackaged in VSS to their corresponding working folder in Eclipse.
There is package.xml file for each force.com related folder in VSS. This file also gets checked out whenever we check out any file under the folder. It will be checked out in any user name depending on who-ever checked out a file first from VSS.
Now when both the user try checking in the Trigger A and Trigger B file back from Eclipse working folder to VSS the eclipse gets hanged and doesn’t allow to check-in because of this package.xml file being checked out.
The users have to close all applications and then do changes one by one to solve this problem.
Is there any way that this problem can be avoided?Any pointers will be reaally helpful.
Thanks
Priya Nair
-
- VN
- April 07, 2009
- Like
- 0
- Continue reading or reply
How to avoid Validation Error in VF?
Hi,
I have created a visualforce page wherin a user can enter search data and click on search button. I have made three fields mandatory for the search. If a user doesnot enter value in any of the 3 mandatory field then an error message called validation error appears on screen as shown below.
Errors j_id0:j_id1:SearchInputs:j_id2:j_id3:j_id22: Validation Error: Value is required. j_id0:j_id1:SearchInputs:j_id2:j_id3:j_id27: Validation Error: Value is required.
Is it possible to avoid this error message and display some custom message?
Please help.
Thanks Priya
-
- VN
- February 16, 2009
- Like
- 0
- Continue reading or reply
Coding Standards for comments in Apex
Is there a coding standard that is being followed when adding comments to Apex code. what we are doing is following the standard as Java as follows.
/** * File Name:
* Description
* Copyright : Infosys Technologies Limited Copyright (c) 2001
* * @author :
* Modification Log ===============================================================
Ver Date Author Modification --- ---- ------ -------------
* */
The above is for the header. Statement we are jus putting a '//' and giving comments. Is it the same way or do we have something specific for Apex? Many Thanks Priya Nair
-
- VN
- February 12, 2009
- Like
- 0
- Continue reading or reply
Validation Rule to check if a field contains specified characters
Hi All,
We have a requirement wherein a field can have any values between 0-9 or special characters comma,spaces,"+","-",";","/",".","(",")". Other than this a user should not be able to enter anything.
Need to write a custom validation rule for this. But not able to achieve the desired functionality. Please help me how to achieve it
Thanks in advance
Priya Nair
-
- VN
- February 10, 2009
- Like
- 0
- Continue reading or reply
Integarting VSS and eclipse iwth force.com IDE
Hi,
We have integrated VSS and Eclipse with force.com IDE. So everytime we update a code we check out from VSS and check in back after update. But if two users are updating different files say Trigger A and Trigger B the eclipse is getting hanged and we are not able to commit the changes that is performed. Could anyone please guide me what could be reason for this? And also how it can be solved.
Thanks
Priya
-
- VN
- February 10, 2009
- Like
- 0
- Continue reading or reply
Parallel Apex Development
Hi,
Has anyone has any idea on what Parallel Apex Development is? If anyone can provide any document or information on this it will be really great.
Thanks
Priya
-
- VN
- February 04, 2009
- Like
- 0
- Continue reading or reply
Custom Approval Process
-
- VN
- August 19, 2008
- Like
- 0
- Continue reading or reply
Best Practice for Apex
-
- VN
- August 13, 2008
- Like
- 0
- Continue reading or reply
Problem with s-Controls
AJAX Toolkit Shell
-
- VN
- August 07, 2008
- Like
- 0
- Continue reading or reply
Doubt in Trigger
-
- VN
- August 05, 2008
- Like
- 0
- Continue reading or reply
PageReference
... <apex:pageBlock title="Enter Filter Criteria"> <apex:form > <b>Marketing Domain</b> <apex:selectList id="domain" size="1" > <apex:selectOptions value="{!items}"/> </apex:selectList> .... <apex:commandButton value="Generate Report" action="{!reset}"> </apex:commandButton> .....
The code for controller class is
.... public Account[] getAccount() { accounts = [Select Name,Customer_Rating1__c,Target_Visit__c,salesdistrict__c,Achieved__c,To_Be_Achieved__c from Account where Marketing_Domain__c=:ApexPages.currentPage().getParameters().get('domain')]; return accounts; } .... public PageReference reset() { PageReference newpage = new PageReference(System.currentPageReference().getURL()); newpage.setRedirect(true); return newpage; } ...
Please Help.
Thanks in advance
Priya Nair
-
- VN
- August 04, 2008
- Like
- 0
- Continue reading or reply
Problem With Triggers
trigger targetvisit on Account (before insert,before update) { Account[] acc = Trigger.new; public Master_Data__c mas1; public Master_Data__c mas2; integer eve; Set<String> acc1 = new Set<String> (); Set<String> acc2 = new Set<String> (); Set<Id> accid = new Set<Id> (); try { acc1.add('Existing Customers - CHAA'); acc2.add('Potential Customers - CHAA'); mas1=[Select Existing_Customers__c from Master_Data__c where Name in :acc1]; mas2=[Select Potential_Customer__c from Master_Data__c where Name in :acc2]; for(Account acnt1:acc) { String rec=acnt1.RecordTypeId; rec=rec.substring(0,15); if(rec.equals('012200000004Tsn')) acnt1.Target_Visit__c=mas2.Potential_Customer__c; else if(rec.equals('012200000004Tss')) acnt1.Target_Visit__c=mas1.Existing_Customers__c; acnt1.To_Be_Achieved__c=acnt1.Target_Visit__c - acnt1.Achieved__c; } } catch(Exception ex) { } }
Please tell me where iam going wrong.
Thanks in advance
Priya Nair
-
- VN
- July 30, 2008
- Like
- 0
- Continue reading or reply
Problem with SelectOption
List<SelectOption> options = new List<SelectOption>();
domain = [Select Marketing_Domain__c from Account];
for(Account a:domain)
{
String b=a.Marketing_Domain__c;
options.add(new SelectOption(b,b));
}
return options;
<apex:selectOptions value="{!items}"/>
-
- VN
- July 29, 2008
- Like
- 0
- Continue reading or reply
Can more than one list of data be passed to datatable?
{
public Account[] getAccount()
{
accounts = [Select Name,Customer_Rating__c,salesdistrict__c,RecordTypeId from Account];
return accounts;
}
public Master_Data__c[] getMasterData()
{
for(Account acc:accounts)
{
master=[Select Existing_Customers__c from Master_Data__c where Name = 'Existing Customers - CHAA'];
}
}
public integer getCount()
{
return count;
}
}
<h1><Center>Account Wise Visit Status Report</Center></h1><br><br></br></br>
<apex:pageBlock title="Account">
<apex:pageBlockTable value="{!Account}" var="accounts" cellPadding="4" border="1">
<apex:facet name="header"><b> Account Name </b></apex:facet>
<apex:outputText value="{!accounts.Name}"/>
</apex:column>
<apex:facet name="header"><b> Customer Rating </b></apex:facet>
<apex:outputText value="{!accounts.Customer_Rating__c}"/>
</apex:column>
<apex:column >
<apex:facet name="header"><b> Achieved </b></apex:facet>
<apex:outputText value="{!count}"/>
</apex:column>
<apex:column >
<apex:facet name="header"><b> Sales District</b></apex:facet>
<apex:outputText value="{!accounts.salesdistrict__c}"/>
</apex:column>
</apex:pageBlock>
</apex:page>
-
- VN
- July 11, 2008
- Like
- 0
- Continue reading or reply
Starts with Vowel Sound
Hi,
Can anyone please let me know why is this checkbox 'Starts with a vowel sound' is used while creating objects in salesforce?
I read somewhere that 'This is used for languages where words need different treatment depending on the first character'.
If anyone can explain me with example on how it works that would be great.
Thanks in advance
Priya Nair
- VN
- April 26, 2010
- Like
- 0
- Continue reading or reply
Problem with s-Controls
AJAX Toolkit Shell
- VN
- August 07, 2008
- Like
- 0
- Continue reading or reply
Doubt in Trigger
- VN
- August 05, 2008
- Like
- 0
- Continue reading or reply
PageReference
... <apex:pageBlock title="Enter Filter Criteria"> <apex:form > <b>Marketing Domain</b> <apex:selectList id="domain" size="1" > <apex:selectOptions value="{!items}"/> </apex:selectList> .... <apex:commandButton value="Generate Report" action="{!reset}"> </apex:commandButton> .....
The code for controller class is
.... public Account[] getAccount() { accounts = [Select Name,Customer_Rating1__c,Target_Visit__c,salesdistrict__c,Achieved__c,To_Be_Achieved__c from Account where Marketing_Domain__c=:ApexPages.currentPage().getParameters().get('domain')]; return accounts; } .... public PageReference reset() { PageReference newpage = new PageReference(System.currentPageReference().getURL()); newpage.setRedirect(true); return newpage; } ...
Please Help.
Thanks in advance
Priya Nair
- VN
- August 04, 2008
- Like
- 0
- Continue reading or reply
Problem With Triggers
trigger targetvisit on Account (before insert,before update) { Account[] acc = Trigger.new; public Master_Data__c mas1; public Master_Data__c mas2; integer eve; Set<String> acc1 = new Set<String> (); Set<String> acc2 = new Set<String> (); Set<Id> accid = new Set<Id> (); try { acc1.add('Existing Customers - CHAA'); acc2.add('Potential Customers - CHAA'); mas1=[Select Existing_Customers__c from Master_Data__c where Name in :acc1]; mas2=[Select Potential_Customer__c from Master_Data__c where Name in :acc2]; for(Account acnt1:acc) { String rec=acnt1.RecordTypeId; rec=rec.substring(0,15); if(rec.equals('012200000004Tsn')) acnt1.Target_Visit__c=mas2.Potential_Customer__c; else if(rec.equals('012200000004Tss')) acnt1.Target_Visit__c=mas1.Existing_Customers__c; acnt1.To_Be_Achieved__c=acnt1.Target_Visit__c - acnt1.Achieved__c; } } catch(Exception ex) { } }
Please tell me where iam going wrong.
Thanks in advance
Priya Nair
- VN
- July 30, 2008
- Like
- 0
- Continue reading or reply
Problem with SelectOption
List<SelectOption> options = new List<SelectOption>();
domain = [Select Marketing_Domain__c from Account];
for(Account a:domain)
{
String b=a.Marketing_Domain__c;
options.add(new SelectOption(b,b));
}
return options;
<apex:selectOptions value="{!items}"/>
- VN
- July 29, 2008
- Like
- 0
- Continue reading or reply
Visual force And Offline edition
- VN
- June 26, 2008
- Like
- 0
- Continue reading or reply
Adding a custom field in Campaign
- VN
- May 09, 2008
- Like
- 0
- Continue reading or reply
Populating a custom field
- VN
- October 26, 2007
- Like
- 0
- Continue reading or reply
Auto populating a custom field using Scontrol
- VN
- October 26, 2007
- Like
- 0
- Continue reading or reply
Invoking an Scontrol
- VN
- October 15, 2007
- Like
- 0
- Continue reading or reply
How to enhance the size of an API create call?
- VN
- October 12, 2007
- Like
- 0
- Continue reading or reply
Uploading files in S-Control
- VN
- October 09, 2007
- Like
- 0
- Continue reading or reply