-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
10Questions
-
8Replies
lightning:accordion icon change
Hi, I would like to know if there is a way to change the chevrondown and chevronup arrow when using lightning:accordion lightning component. I know it is doable using lightning accordion design system.
I have the requirement to use utility:down and utility:up instead of what it shows now.
I would like to know if there is a way it can be done on the css or on the lightning controller on the init function.
I have the requirement to use utility:down and utility:up instead of what it shows now.
I would like to know if there is a way it can be done on the css or on the lightning controller on the init function.
-
- ksmo
- December 10, 2019
- Like
- 0
- Continue reading or reply
success message after the update has been made and clear it
on the update button I have the below logic in apex class
PageReference pageRef = Page.ITEM_VFPAGE;
pageRef.setRedirect(true);
pageref.getParameters().put('ShowMessage','1');
return pageRef;
On the construcor
if(ApexPages.currentPage().getParameters().get('ShowMessage') != null)
{
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Info, 'Record Successfully Updated.!'));
}
on the vf page I have the apex:pagemessge which displays the message on the vf page.
After the record is updated the message is displaying correctly, but if the user continues to make changes that message should go away. How to acheive this?
PageReference pageRef = Page.ITEM_VFPAGE;
pageRef.setRedirect(true);
pageref.getParameters().put('ShowMessage','1');
return pageRef;
On the construcor
if(ApexPages.currentPage().getParameters().get('ShowMessage') != null)
{
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Info, 'Record Successfully Updated.!'));
}
on the vf page I have the apex:pagemessge which displays the message on the vf page.
After the record is updated the message is displaying correctly, but if the user continues to make changes that message should go away. How to acheive this?
-
- ksmo
- April 26, 2017
- Like
- 0
- Continue reading or reply
on the click of save button it should check condition and popup message and prevent save
I have a button update as below
<apex:commandButton id="UpdateButton" value="UPDATE" styleClass="UpdateButton" onclick="CheckAcceptOnUpdate()" action="{!doSave}"/>
on the apex class the do save does the update to the database perfectly.
But now I want that update to work only if accept checkbox is checked so I have written the onclick function
function CheckAcceptOnUpdate()
{
var accept = document.getElementById('{!$Component.formterm.terms}').checked;
if(accept==false)
{
alert("please accept terms");
}
}
The popup is working as expected and it is not preventing the update function.the action dosave is being called. If the accept checkbox is not checked, it should only show the pop up and do nothing else.
<apex:commandButton id="UpdateButton" value="UPDATE" styleClass="UpdateButton" onclick="CheckAcceptOnUpdate()" action="{!doSave}"/>
on the apex class the do save does the update to the database perfectly.
But now I want that update to work only if accept checkbox is checked so I have written the onclick function
function CheckAcceptOnUpdate()
{
var accept = document.getElementById('{!$Component.formterm.terms}').checked;
if(accept==false)
{
alert("please accept terms");
}
}
The popup is working as expected and it is not preventing the update function.the action dosave is being called. If the accept checkbox is not checked, it should only show the pop up and do nothing else.
-
- ksmo
- April 26, 2017
- Like
- 0
- Continue reading or reply
onclick if condition on the div element
On the click of this checkbox it should bring a popup but based on a condition.
<input id="showprompt" type="checkbox" name="Name" value="Name "onclick="if({!item.name='test'),ShowPrompt(this.checked)" />
I want the correct syntax
<input id="showprompt" type="checkbox" name="Name" value="Name "onclick="if({!item.name='test'),ShowPrompt(this.checked)" />
I want the correct syntax
-
- ksmo
- April 18, 2017
- Like
- 0
- Continue reading or reply
how to pass values from vf page to apex on the click of a div element
Below is the code for update button and the text panel on the vf page
<div id="UpdateButton">
UPDATE
</div>
<input id="textpaneljs" type="text" name="txt" size="35" value="{!myoutput}"/></div>
I have written the below code on the vf page
<apex:actionFunction name="update" action="{!update}" rerender="">
<apex:param name="companyname" value="" />
</apex:actionFunction>
then on the apex class
public void update(){
String CName = ApexPages.currentPage().getParameters().get('companyname');
system.debug('the customized 123 are '+CName);
}
then on jquery in static resource
var companyname = j$('#textpaneljs').val();
function setupClickEvents(){
j$('#cockpitUpdateButton').click(function(){
update(companyname);
});
}
On the system debug statemnet I am getting only null
<div id="UpdateButton">
UPDATE
</div>
<input id="textpaneljs" type="text" name="txt" size="35" value="{!myoutput}"/></div>
I have written the below code on the vf page
<apex:actionFunction name="update" action="{!update}" rerender="">
<apex:param name="companyname" value="" />
</apex:actionFunction>
then on the apex class
public void update(){
String CName = ApexPages.currentPage().getParameters().get('companyname');
system.debug('the customized 123 are '+CName);
}
then on jquery in static resource
var companyname = j$('#textpaneljs').val();
function setupClickEvents(){
j$('#cockpitUpdateButton').click(function(){
update(companyname);
});
}
On the system debug statemnet I am getting only null
-
- ksmo
- April 18, 2017
- Like
- 0
- Continue reading or reply
when checkbox is checked show popup and whne unchecked show different popup
I want the dialog popup to display only when the checkbox is checked, but this code displys when checked and unchecked. I want a different pop up for uncheck..How do I write that script?
checkbox code
<input id="showprompt" type="checkbox" name="CO_BRAND" value="cobrand" onclick="ShowPrompt()" />
Javascript Code
<script>
var checkmodal = document.getElementById('checkboxModal');
var btn = document.getElementById("showprompt");
var span = document.getElementsByClassName("checkboxclose")[0];
function ShowPrompt()
{
checkmodal.style.display = "block";
}
span.onclick = function() {
checkmodal.style.display = "none";
}
window.onclick = function(event) {
if (event.target == modal) {
checkmodal.style.display = "none";
}
}
checkbox code
<input id="showprompt" type="checkbox" name="CO_BRAND" value="cobrand" onclick="ShowPrompt()" />
Javascript Code
<script>
var checkmodal = document.getElementById('checkboxModal');
var btn = document.getElementById("showprompt");
var span = document.getElementsByClassName("checkboxclose")[0];
function ShowPrompt()
{
checkmodal.style.display = "block";
}
span.onclick = function() {
checkmodal.style.display = "none";
}
window.onclick = function(event) {
if (event.target == modal) {
checkmodal.style.display = "none";
}
}
-
- ksmo
- April 13, 2017
- Like
- 0
- Continue reading or reply
popup message which renders through the repeat
I have the below button on vf page.
<div id="previewButton" onclick="ShowPopup()">
Javascript on the vf page
<script>
var modal = document.getElementById('previewModal');
var btn = document.getElementById("previewButton");
var span = document.getElementsByClassName("previewclose")[0];
<!--Script for Preview Popup-->
function ShowPopup()
{
modal.style.display = "block";
}
span.onclick = function() {
modal.style.display = "none";
}
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
Modal Pop up on the vf page
<div id="previewModal" class="preview">
<div class="previewbody ">
<div class="previewtitleholder">
<div class="previewtitle">
TITLE
<span class="previewclose"> ×</span>
</div>
</div>
<div class="cockpitpreviewtext">
test
{!item.messagepreview}
</div>
</div>
</div>
whne I click on the popup it should go throughthe the meesage preview field of each item record and display that message in the popup.But with this code no message appears..it is just blank.
<div id="previewButton" onclick="ShowPopup()">
Javascript on the vf page
<script>
var modal = document.getElementById('previewModal');
var btn = document.getElementById("previewButton");
var span = document.getElementsByClassName("previewclose")[0];
<!--Script for Preview Popup-->
function ShowPopup()
{
modal.style.display = "block";
}
span.onclick = function() {
modal.style.display = "none";
}
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
Modal Pop up on the vf page
<div id="previewModal" class="preview">
<div class="previewbody ">
<div class="previewtitleholder">
<div class="previewtitle">
TITLE
<span class="previewclose"> ×</span>
</div>
</div>
<div class="cockpitpreviewtext">
test
{!item.messagepreview}
</div>
</div>
</div>
whne I click on the popup it should go throughthe the meesage preview field of each item record and display that message in the popup.But with this code no message appears..it is just blank.
-
- ksmo
- April 13, 2017
- Like
- 0
- Continue reading or reply
popup message on navigating from a page without saving
I have a text box and few checkboxes on the page. If the user enters,changes existing text,clciks or unclicks the checkbox and clicks the cancel button or navigates away from the page I want a pop-up message saying yor changes have not been saved
-
- ksmo
- April 13, 2017
- Like
- 0
- Continue reading or reply
Button should change color based on when text is entered
Hi,
I have a button which is a div element. The css for this button is that it is grey in color.
<div class="UpdateButton"> UPDATE </div>
When text is inputted in the text box the color of the button should change to red.
<div class="textpanel"> <input type="text" size="35" /><br/></div>
Similrly ther eis a checkbox on visualforce componenet which is referenced on the visualforce page. If that checkbox is checked the button should change to red.
I have a button which is a div element. The css for this button is that it is grey in color.
<div class="UpdateButton"> UPDATE </div>
When text is inputted in the text box the color of the button should change to red.
<div class="textpanel"> <input type="text" size="35" /><br/></div>
Similrly ther eis a checkbox on visualforce componenet which is referenced on the visualforce page. If that checkbox is checked the button should change to red.
-
- ksmo
- April 12, 2017
- Like
- 0
- Continue reading or reply
apex repeat
Hi,
Inside the <apex:repeat> I am having around 5 divs which get populated based on the number of times the apex repeat value has.So if there are 5 items the title,checkboxname,heckbox and preview button gets populated 5 times to the side of the item. But for the checkbox alone I want it to populate only once and not 5 times. How do I acheive this?
<div class="xContent">
<apex:repeat value="{!itemList}"
var="item">
<div class="xRow">
<div class="xRowRight">
<apex:outputPanel rendered="{!ifPDF != true}">
<div class="xRowName ">
{!benefit.cockpittitle}
<div class="xcheckboxname">
CHECKBOXNAME
</div> <br/>
</div>
</apex:outputpanel>
<div class="Xrowcategorypanel">
<div class="Xcheckboxpanel">
<input id="changecolor" type="checkbox" name="BRAND" onclick="Changecolor()" />
<div id="XpreviewButton" onclick="ShowPopup()">
PREVIEW <img class="cockpitImage"
src="{!URLFOR($Resource.BEN_IM, 'magnifying.png')}"/>
</div>
</div>
</div>
</div>
</div>
</div>
Inside the <apex:repeat> I am having around 5 divs which get populated based on the number of times the apex repeat value has.So if there are 5 items the title,checkboxname,heckbox and preview button gets populated 5 times to the side of the item. But for the checkbox alone I want it to populate only once and not 5 times. How do I acheive this?
<div class="xContent">
<apex:repeat value="{!itemList}"
var="item">
<div class="xRow">
<div class="xRowRight">
<apex:outputPanel rendered="{!ifPDF != true}">
<div class="xRowName ">
{!benefit.cockpittitle}
<div class="xcheckboxname">
CHECKBOXNAME
</div> <br/>
</div>
</apex:outputpanel>
<div class="Xrowcategorypanel">
<div class="Xcheckboxpanel">
<input id="changecolor" type="checkbox" name="BRAND" onclick="Changecolor()" />
<div id="XpreviewButton" onclick="ShowPopup()">
PREVIEW <img class="cockpitImage"
src="{!URLFOR($Resource.BEN_IM, 'magnifying.png')}"/>
</div>
</div>
</div>
</div>
</div>
</div>
-
- ksmo
- April 12, 2017
- Like
- 0
- Continue reading or reply
on the click of save button it should check condition and popup message and prevent save
I have a button update as below
<apex:commandButton id="UpdateButton" value="UPDATE" styleClass="UpdateButton" onclick="CheckAcceptOnUpdate()" action="{!doSave}"/>
on the apex class the do save does the update to the database perfectly.
But now I want that update to work only if accept checkbox is checked so I have written the onclick function
function CheckAcceptOnUpdate()
{
var accept = document.getElementById('{!$Component.formterm.terms}').checked;
if(accept==false)
{
alert("please accept terms");
}
}
The popup is working as expected and it is not preventing the update function.the action dosave is being called. If the accept checkbox is not checked, it should only show the pop up and do nothing else.
<apex:commandButton id="UpdateButton" value="UPDATE" styleClass="UpdateButton" onclick="CheckAcceptOnUpdate()" action="{!doSave}"/>
on the apex class the do save does the update to the database perfectly.
But now I want that update to work only if accept checkbox is checked so I have written the onclick function
function CheckAcceptOnUpdate()
{
var accept = document.getElementById('{!$Component.formterm.terms}').checked;
if(accept==false)
{
alert("please accept terms");
}
}
The popup is working as expected and it is not preventing the update function.the action dosave is being called. If the accept checkbox is not checked, it should only show the pop up and do nothing else.
- ksmo
- April 26, 2017
- Like
- 0
- Continue reading or reply
how to fetch the value of custom object values to visualforce page input fields
how can we fetch the value of custom object values to visualforce page input fields
- ruheena mohammed 9
- April 18, 2017
- Like
- 0
- Continue reading or reply
when checkbox is checked show popup and whne unchecked show different popup
I want the dialog popup to display only when the checkbox is checked, but this code displys when checked and unchecked. I want a different pop up for uncheck..How do I write that script?
checkbox code
<input id="showprompt" type="checkbox" name="CO_BRAND" value="cobrand" onclick="ShowPrompt()" />
Javascript Code
<script>
var checkmodal = document.getElementById('checkboxModal');
var btn = document.getElementById("showprompt");
var span = document.getElementsByClassName("checkboxclose")[0];
function ShowPrompt()
{
checkmodal.style.display = "block";
}
span.onclick = function() {
checkmodal.style.display = "none";
}
window.onclick = function(event) {
if (event.target == modal) {
checkmodal.style.display = "none";
}
}
checkbox code
<input id="showprompt" type="checkbox" name="CO_BRAND" value="cobrand" onclick="ShowPrompt()" />
Javascript Code
<script>
var checkmodal = document.getElementById('checkboxModal');
var btn = document.getElementById("showprompt");
var span = document.getElementsByClassName("checkboxclose")[0];
function ShowPrompt()
{
checkmodal.style.display = "block";
}
span.onclick = function() {
checkmodal.style.display = "none";
}
window.onclick = function(event) {
if (event.target == modal) {
checkmodal.style.display = "none";
}
}
- ksmo
- April 13, 2017
- Like
- 0
- Continue reading or reply
popup message on navigating from a page without saving
I have a text box and few checkboxes on the page. If the user enters,changes existing text,clciks or unclicks the checkbox and clicks the cancel button or navigates away from the page I want a pop-up message saying yor changes have not been saved
- ksmo
- April 13, 2017
- Like
- 0
- Continue reading or reply
Button should change color based on when text is entered
Hi,
I have a button which is a div element. The css for this button is that it is grey in color.
<div class="UpdateButton"> UPDATE </div>
When text is inputted in the text box the color of the button should change to red.
<div class="textpanel"> <input type="text" size="35" /><br/></div>
Similrly ther eis a checkbox on visualforce componenet which is referenced on the visualforce page. If that checkbox is checked the button should change to red.
I have a button which is a div element. The css for this button is that it is grey in color.
<div class="UpdateButton"> UPDATE </div>
When text is inputted in the text box the color of the button should change to red.
<div class="textpanel"> <input type="text" size="35" /><br/></div>
Similrly ther eis a checkbox on visualforce componenet which is referenced on the visualforce page. If that checkbox is checked the button should change to red.
- ksmo
- April 12, 2017
- Like
- 0
- Continue reading or reply
show javascript popup when user navigates away from page
hi all,
i have a requirement where in i want to alert a user whenever the user navigates away from the webpage without clicking on save button and navigating away instead of that..i tried the below code but its not working..
below is my code
Can anyone please suggest as to how can i correct my code?
thanks,
i have a requirement where in i want to alert a user whenever the user navigates away from the webpage without clicking on save button and navigating away instead of that..i tried the below code but its not working..
below is my code
<apex:page controller="VistAudit_VFC" action="{!createData}"> <body onload="myfunction()"> <script> function myFunction() { alert("Are you sure you want to navigate away?"); } </script> <apex:form > <apex:outputLabel value="Audit Visit" style="font-family:Times New Roman;font-size:18px"></apex:outputLabel><br></br> <div align="center" draggable="false" > <apex:commandButton value="Save" action="{!save}" onclick="myFunction();"/> </div> .......... ........... ....... </apex:form> </body> </apex:page>
Can anyone please suggest as to how can i correct my code?
thanks,
- SFDC coder
- November 14, 2014
- Like
- 0
- Continue reading or reply
apex:repeat and apex:variable
Hi,
I have seen in many examples but donot know when and in which situation should we use <apex;repeat> within <apex:variable>.
CAn some one understand me with example?
.
- Kaity
- August 07, 2013
- Like
- 0
- Continue reading or reply