• ksmo
  • NEWBIE
  • 40 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 8
    Replies
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.
  • December 10, 2019
  • Like
  • 0
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?
 
  • April 26, 2017
  • Like
  • 0
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.

 
  • April 26, 2017
  • Like
  • 0
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
  • April 18, 2017
  • Like
  • 0
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
  • April 18, 2017
  • Like
  • 0
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";
    }
}
  • April 13, 2017
  • Like
  • 0
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"> &times;</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.
 
  • April 13, 2017
  • Like
  • 0
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
  • April 13, 2017
  • Like
  • 0
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.
  • April 12, 2017
  • Like
  • 0
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>
 
  • April 12, 2017
  • Like
  • 0
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.

 
  • April 26, 2017
  • Like
  • 0
how can we fetch the value of custom object values to visualforce page input fields
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";
    }
}
  • April 13, 2017
  • Like
  • 0
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
  • April 13, 2017
  • Like
  • 0
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.
  • April 12, 2017
  • Like
  • 0
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

 
<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,
 

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?

 

 

 

 

.

  • August 07, 2013
  • Like
  • 0