• Adam Howarth
  • NEWBIE
  • 80 Points
  • Member since 2013

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 25
    Replies

hi, I was trying jquery dialog box in visual force page and was seeing some issue when the dialog box is displayed.

 

  1. I see a border for the email link, when I havent specified one.
  2. When i click on email link in the dialog box, it unhides the 'test' div but the page is reloading and its taking me away.It should unhide and leave me on the same dialog box.

please look at it and let me know if i am doing anything wrong

 

<apex:page showheader="false" standardController="Account" recordsetVar="accounts" showHeader="true">
<apex:form >
<head>
<apex:includeScript value="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" />
<apex:includeScript value="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js" />
<apex:stylesheet value="//ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery.ui.theme.css"/>
<apex:stylesheet value="//ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery.ui.base.css"/>

<style>
.accountLink { color: blue; cursor: pointer; cursor: hand;text-decoration:underline;font-style:italic; }
</style>

<script type="text/javascript">
$(document).ready(function() {
$('#dialog').hide();
$('#test').hide();
$('#dialog').dialog({
title: "Choose Activity ",
autoOpen: false,
resizable: false,


});
});

function showDialog(){
$("#dialog").dialog('open')

}

function showalert(){
$('#test').show();
}
</script>


</head>

<body>

<a href="" class="accountLink" onclick="showDialog()">Activity</a>
<div id="dialog" >
<apex:outputPanel >
This is the content that will be displayed in the dialog box.
<apex:outputLink value="" onclick="showalert()">Email</apex:outputLink>
</apex:outputPanel>
<div id="test">
Test
</div>
</div>
</body>
</apex:form>
</apex:page>

Hey guys,

 

I am creating an app that I will be putting on the app exchange soon. But wondered if it was possible to install a scheduled job as part of the app or do I have to handle it in code?

 

i.e. check whether there is a schedule, if not create one? 

 

Cheers,

Adam

Hey guys,

 

Ran into an issue which looks like a bug to me.

 

So I have some controls for a VF page at the top inside an output panel. The output panel is rendered based on a certain value in the custom controller I am using. Now when i try and use the command buttons inside the panel, the page just refreshes and the action method is not hit at all.

 

<apex:outputPanel rendered="{!statusCode == 200}">
<table style="width:100%;">
<tr>
<td style="vertical-align: middle;">

<apex:commandButton action="{!RedirectToReports}" title="PDF" value="PDF" ></apex:commandButton>

</td>

</tr>

</table>

</apex:outputPanel>

 

If I remove [ rendered="{!statusCode == 200}" ] then the page works correctly and the buttons do what they are meant to.

 

Is this by design or have i stumbled upon a really basic bug?

 

Cheers

Hey guys,

 

Ran into an issue which looks like a bug to me.

 

So I have some controls for a VF page at the top inside an output panel. The output panel is rendered based on a certain value in the custom controller I am using. Now when i try and use the command buttons inside the panel, the page just refreshes and the action method is not hit at all.

 

<apex:outputPanel rendered="{!statusCode == 200}">
<table style="width:100%;">
<tr>
<td style="vertical-align: middle;">

<apex:commandButton action="{!RedirectToReports}" title="PDF" value="PDF" ></apex:commandButton>

</td>

</tr>

</table>

</apex:outputPanel>

 

If I remove [ rendered="{!statusCode == 200}" ] then the page works correctly and the buttons do what they are meant to.

 

Is this by design or have i stumbled upon a really basic bug?

 

Cheers

Hey guys,

 

I have got this working but it looks horrible!

 

Is there anything more efficient or out of the box to convert a string in the format yyyy-MM-ddTHH:mm:ss.SSSZ to a date object.

 

Tried parsing after removing the time, valueOf etc.

 

Heres my code:

 

// Parses the returned datetime (yyyy-MM-ddTHH:mm:ss.SSSZ)
private date ParseDateTime(string value)
{
String[] dateAndTime = value.split('T');
String[] dateParts = dateAndTime[0].split('-');

return date.newinstance(Integer.valueOf(dateParts[0]), Integer.valueOf(dateParts[1]),Integer.valueOf(dateParts[2]));
}

 

 

Cheers,

Adam

Hi all,

 

My senario is that I have a Page with Multiple select options and Pagination(Using wrapper class). 

What happen is this when I change my values in page and navigate to next set of records using StandardSet controller next() methord I run into this error..

 

 

"Modified rows exist in the records collection!"

 

So I tried to again make my controller object null and again bind the record list with it but same issue.

 

What to do in this senario!!

 

public void pnext(){
    if(recList != null){
        tempmapofWRP = new Map<Id,boolean> ();
        List<PO_LineItem__c> tempUpdatePOLINE = new List<PO_LineItem__c>();
        for(wrapperRec wrp: recList){
            wrpMap.put(wrp.record.Id,wrp) ;
            tempmapofWRP.put(wrp.record.Id,wrp.check);
        }
        for(wrapperRec wrp:wrpMap.values()){
            tempUpdatePOLINE.add(wrp.record);
        }
        validationRec();
        con.save();
        system.debug('***con before null*****'+con);
        system.debug('***con after null*****');
        system.debug('****tempUpdatePOLINE****'+tempUpdatePOLINE);
        
        /*con = null;
        con = new ApexPages.StandardSetController(tempUpdatePOLINE);
        con.setPageSize(10);
        */
        system.debug('***con new bind*****'+con);
        system.debug('****before caon next*****');
        con.next();
        system.debug('***Next called ****');
        wrltemplist =  new List<wrapperRec>();
        system.debug('***before getrecordcall *****');
        wrltemplist  = getrecordList();
        for(wrapperRec wrp: wrltemplist ){
            if(wrpMap.containsKey(wrp.record.Id)){
                wrp.check=wrpMap.get(wrp.record.Id).check;
            }
        }
    }
    else{
        wrltemplist =  new List<wrapperRec>();
        wrltemplist  = getrecordList();
    }
}  

 

 

  • March 26, 2013
  • Like
  • 0

Hello All,

 

Below java Script code is working fine in all browsers. But this is not working in IE.
Please anyone give an immediate response.

This is Java Script code on VF Page

function checkAcknowledgement(){
 if (acknowledgement.checked == false){
alert('Please read Agreement and Terms.');
return false;
}else {
return true;
}
}

 

This is input tag in the VF page where i used the above Java Script.

<input type="checkbox" id="acknowledgement" name="ack" />&nbsp;&nbsp; &nbsp; &nbsp;I agree to these terms &nbsp;&nbsp;  &nbsp;&nbsp; &nbsp;<apex:commandLink value="View" style="color:red;" onclick="check1();return false;" /> &nbsp;&nbsp; &nbsp; &nbsp;   </td> (This is check box.)

 

<apex:outputText rendered="{!boolimg}"><apex:commandLink action="{!insertPayInfo}"  id="theCommandLink2"     onclick="return checkAcknowledgement(this)" >  <apex:image value="{!$Resource.PayNow}" /></apex:commandLink></apex:outputText> (This is Command Button. When i click this button it should give java script alert pop up, if the checkbox is not checked)

 

Thanks,

Uday

  • March 26, 2013
  • Like
  • 0

Hi,

 

I have a field as a rich textarea. I use inputField display this field on my vf page. But I don't know how to get the value by js or jquery. And I foung this is an iframe generagte automatically when I check the page source.

 

Does anyone knows this?

 

Thank you!

Hi

 

I am trying to render  a VF page  as PDF, the issue is that it looses all its CSS styling when I do that, please help :

 

VF page :

 

<apex:page controller="APController" id="pgAP" sidebar="false" showHeader="false">   
   <head>
     <style>
        .cls {font-size:9pt;
              font-weight:bold!important;
              white-space:pre-wrap;}  
     </style>
   </head>
   <apex:form id="frm1">
      <!-- <apex:pageBlock title="AP report" id="blk1">  -->
         <table border="1">
           <th>Contact</th>
            <tr>
             <td width="300">   
              <apex:repeat value="{!lstContacts}" var="cn" id="theRepeat">
                <apex:outputText styleClass="cls" value="{!cn.Name}" id="theName" /><br/>
                <apex:outputText styleClass="cls" value="{!cn.Title}" id="theTitle"/><br/>
              </apex:repeat>
             </td>
            </tr>
           </table>
      <!--  </apex:pageBlock>  -->
   </apex:form>
</apex:page>

 

Thanks

Shasvat

Hello,

 

I'm working on creating my first visual force page.  Here is my code:

<apex:page controller="clsProjectOverview">
    <apex:pageBlock >
        <apex:pageblocktable value="{!milestones}"  var="m">
            <apex:column headervalue="Milestones">
                <apex:outputtext value="{!m.Name}"/>
            </apex:column>
            <apex:column >
                   <apex:facet name="header">                                        
                         Actions                                                                               
                    </apex:facet>
                    <apex:pageblocktable value="{!m.Actions__r}" var="a"  cellpadding="5">
                        <apex:column headerValue="Action Name">
                               <apex:outputText value="{!a.Name}"/>
                         </apex:column>
                        <apex:column headerValue="Status" >
                            <apex:outputText value="{!a.Status__c}" style="{!IF((a.Status__c='Planned'),'background-color:red','background-color:green')}"  />
                            </apex:column>
                        <apex:column headerValue="Start Date">
                               <apex:outputText value="{!a.Start_Date__c}"/>
                         </apex:column>
                        <apex:column headerValue="End Date">
                               <apex:outputText value="{!a.End_Date__c}"/>
                         </apex:column>
                    </apex:pageblocktable>
            </apex:column>
        </apex:pageblocktable>
    </apex:pageBlock>
</apex:page>

 

As you can see, I'm trying to set the color of an output text field.  This is working, but the color only applies to the text.  It would look much better if the full cell was the back-color I wanted.

 

How can I accomplish this?  If I put <td> and </td> before/after my output text field, it works, but it moves the values over one column to the right.

 

Any suggestions?

 

Thanks

Hi,

    I have one text box and one button,by giving name and click on button then automatically thus name related records are into  PageBlockTable.Iam retrieving records by Dynamic soql i.e,Database.query('select id,name from '+sobj+'where name like: ' +name); but i want to display these name based records  in pageblocktable.It's for different objects,once check it.

if i give <apex:column value="{!a.name}">,it also shows an error ..so any one helpme out...

Hi all,

 

Any idea how to align two inputField within a <fieldset> on the same line, without using <table> ?

 

 

Hi,

 

Suppose I have the list of fields of an Object using:

 

Map<String, Schema.SObjectField> FMap = Schema.SObjectType.CustomObject__c.fields.getMap();

CustomObject__c tempRecord=new CustomObject__c();

List<String> mainList=new List<String>();

Set<String> tempSet=FMap.keySet();

for(String s:tempSet)

mainList.add(s);

 

Now, Can you show all these fields on the VF page in Input mode ?

 

In other words, assume the first field is Text, so I should get <apex:inputText>. At present, we can assume that all fields are text.

what can be possible VF code. I was thinking something with the repeat tag.

 

 

Hi All,

  i have written following class for inserting and updating the record.in this updateledger method calling upsert command.when new record is inserted.this method not called.Can u please help me this.

public with sharing class newpagecontroller {
public void ledgerNewTable() {
ledgeradd = true;
}
public PageReference addLEdger() {
insert newledger;
newLedger = new Ledger__c();
return null;
}
public boolean ledgeradd{get;set;}
public string editid{get;set;}
public string updateid{get;set;}
public string delid{get;set;}
public string anum{get;set;}
public string aname{get;set;}
public string atype{get;set;}
public boolean addglopp{get;set;}
public Ledger__c newLedger { get; set; }
public Ledger__c ledgercreation { get; set; }
private List<Ledger__c> ledgertable;
public List<Ledger__c> getledgertable(){
ledgertable = [ SELECT Id,Name,Account_Name__c,Account_Number__c,Account_Type__c,Description__c,Notes__c,Sub_Account__c FROM Ledger__c where Id != null];
if(ledgeradd == true){
ledgertable.add(new Ledger__c());
}
ledgeradd =false;
return ledgertable;
}
public void setledgertable(List<Ledger__c> ledgertable){this.ledgertable= ledgertable;}


public list<Ledger__c> editLedger{get;set;}

public void editLedger() {
editid = ApexPages.currentPage().getParameters().get('editid');
editLedger = [ SELECT Id,Name,Account_Name__c,Account_Number__c,Account_Type__c,Description__c,Notes__c,Sub_Account__c FROM Ledger__c where Id =:editid];
}
public void updateLedger(){
System.debug('updateeeeeeeeeeeeeee');
upsert ledgertable;
}

}

 

 

Page:

<apex:page controller="newpage">
<apex:form >
<apex:pageblock >
<apex:pageBlockSection title="General Ledgers" id="ledgerlist" columns="1">

<apex:pageBlockSectionItem >
<apex:inputcheckbox value="{!addglopp}">
<apex:actionsupport event="onchange" />
</apeX:inputCheckbox>
<apex:outputLabel value="Add GL Information to opportunities"></apex:outputLabel>
</apex:pageBlockSectionItem>

<apex:outputPanel id="glgr">
<apex:outputPanel rendered="{!addglopp}">

<apex:pageblocktable value="{!ledgertable}" var="lgredit" id="lgrtable" cellspacing="-10px" styleclass="datatables">
<apex:variable value="0" var="rowNumlgr"/>
<apex:column headerValue="Account Name">
<apex:outputField value="{!lgredit.Account_Name__c}" rendered="{!IF(lgredit.Id == editid ,false,true)}"/>
<apex:inputField value="{!lgredit.Account_Name__c}" rendered="{!IF(lgredit.Id == editid,true,false)}" styleClass="aname{!rowNumlgr}"/>
</apex:column>
<apex:column >
<apex:commandbutton action="{!editLedger}" value="Edit" rerender="glgr" rendered="{!IF(lgredit.Id == editid ,false,true)}" >
<apex:param name="editid" value="{!lgredit.Id}"/>
</apex:commandbutton>
<apex:commandbutton action="{!updateLedger}" value="Update" rendered="{!IF(lgredit.Id == editid ,true ,false)}"/ >
<apex:param name="updateid " value="{!lgredit.Id}"/>
</apex:column>

</apex:pageblocktable>
</apex:outputPanel>
</apex:outputPanel>
<apex:commandButton action="{!ledgerNewTable}" value="Add GL Account" rerender="glgr" rendered="{!addglopp}"/>
</apex:pageblocksection>
</apex:pageBlock>

</apex:form>
</apex:page>

 

 

Thanks in advance

Hello ,

I am trying to do some excel calculation  in Visual force page. after save that  some of the data table  need to Downloaded to Excel.sheet. Is there any possibility to export data to Excel with the whole Data table ?

 

Regards

Kam

Hey guys,

 

Ran into an issue which looks like a bug to me.

 

So I have some controls for a VF page at the top inside an output panel. The output panel is rendered based on a certain value in the custom controller I am using. Now when i try and use the command buttons inside the panel, the page just refreshes and the action method is not hit at all.

 

<apex:outputPanel rendered="{!statusCode == 200}">
<table style="width:100%;">
<tr>
<td style="vertical-align: middle;">

<apex:commandButton action="{!RedirectToReports}" title="PDF" value="PDF" ></apex:commandButton>

</td>

</tr>

</table>

</apex:outputPanel>

 

If I remove [ rendered="{!statusCode == 200}" ] then the page works correctly and the buttons do what they are meant to.

 

Is this by design or have i stumbled upon a really basic bug?

 

Cheers

I am new to visualforce. Right now i am facing the following problem. Please help me.

 

I am designing a dashboard using visualforce. Can any one help me to include a drop down list box in visualforce, so that user can select a close quarter?

 

     eg : Close Quarter

            Q3 2012

    

 

If User selects a Quarter, then i have to display the day of the quarter in visualforce page in the following format.

 

   Q3 2012 Day 42 of 92

 

Please help me with some code to achieve this .its urgent

 

Regards,

S.Sivakumar

How render a page as PDF without effecting its styles

 

Hi frndz,

                I have a scenario i.e, iam querying a records by Dynamic SOQL with retun type list<sobject>.I want to display thus retrieved fields in a PageBlock Table for that object...How can i acheive this..

Class:

    public PageReference pbrecords() {
    
    List<sobject> recs=Database.query('Select id,Name from '+sobj+' Where Name =:'+name);
        selected_Objrecs =new list<sobject>();
        for(sobject s:recs){
        
            selected_Objrecs.add(s);
        }
        return null;
    }

  public list<sobject> selected_Objrecs { get; set; }

----------------------

V.F:

<apex:pageBlockTable value="{!selected_Objrecs}" var="a">
                  <apex:column value="{!a}" />
    </apex:pageBlockTable>

Hi all,

    i have one question to ask...!!!!!!!!!

There is a vf page which contains some records of account and in front of every record there is one picklist field(i created using <apex:selectlist>) which has 3 values red,blue,green...n there is a custom text field "priority" on account object...all i need is whenever i select any value in vf page so the same value should be inserted into the custom text field...and there is a save update button on vf page which do all this process...

 

BRIEF SUMMARY :

- select any value(blue,green,red) on vf page for any record

- after clicking save the same value should be inserted into the account record's custom field "priority"....

 

any help would be appreciated....thanks in advance....

hi, I was trying jquery dialog box in visual force page and was seeing some issue when the dialog box is displayed.

 

  1. I see a border for the email link, when I havent specified one.
  2. When i click on email link in the dialog box, it unhides the 'test' div but the page is reloading and its taking me away.It should unhide and leave me on the same dialog box.

please look at it and let me know if i am doing anything wrong

 

<apex:page showheader="false" standardController="Account" recordsetVar="accounts" showHeader="true">
<apex:form >
<head>
<apex:includeScript value="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" />
<apex:includeScript value="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js" />
<apex:stylesheet value="//ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery.ui.theme.css"/>
<apex:stylesheet value="//ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery.ui.base.css"/>

<style>
.accountLink { color: blue; cursor: pointer; cursor: hand;text-decoration:underline;font-style:italic; }
</style>

<script type="text/javascript">
$(document).ready(function() {
$('#dialog').hide();
$('#test').hide();
$('#dialog').dialog({
title: "Choose Activity ",
autoOpen: false,
resizable: false,


});
});

function showDialog(){
$("#dialog").dialog('open')

}

function showalert(){
$('#test').show();
}
</script>


</head>

<body>

<a href="" class="accountLink" onclick="showDialog()">Activity</a>
<div id="dialog" >
<apex:outputPanel >
This is the content that will be displayed in the dialog box.
<apex:outputLink value="" onclick="showalert()">Email</apex:outputLink>
</apex:outputPanel>
<div id="test">
Test
</div>
</div>
</body>
</apex:form>
</apex:page>