• SirishaM
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 24
    Questions
  • 25
    Replies
I've got a nice S-Control that lets me see all my time entries for the week on one page. I see a view of the data and if I hit the edit button on an entry, I flip to an edit form.

I want to rebuild this in VisualForce and I'm struggling around how to produce that pattern.

In JS I had a Div with the HTML for displaying the record, and when I hit the edit button, I replaced the complete contents of the DIV with an edit form. On save, I replace the contents again, back to the view HTML.

If I'm displaying a list of entries in VF, I can easily display them as outputText or inputFields. And I know how to rerender elements. But any ideas on the best way to flip between view and edit modes?

Thanks!

Steve
 
I need to handle exception and show my person message(like record is deleted) when user try to fetch data which is already deleted.
 
I wrote code like this in extention controller.
 
Code:
  public MyControllerExtension(ApexPages.StandardController stdController) {
     
      try {               
     
     
      this.acct  = [select id, name, site,Account_Manager__c,RecordTypeId,Dealer_ID__c,OwnerId from Account where id =
                       :System.currentPageReference().getParameters().get('id')];
      this.profile=[Select p.Name From Profile p where p.Id=:UserInfo.getProfileId()];
       } catch (System.QueryException e) {       
        
             ApexPages.addMessages(e);           
        }       
     
      init();
    }

 And page is like this.
Code:
<apex:page standardController="Account" extensions="MyControllerExtension" action="{!doRedirect}">
<apex:pageMessages />

       <apex:detail relatedList="true" relatedListHover="true"subject="{!account.id}"/>

   </apex:page>

Now this page shows message which is not user readable.Istead of standard message,I need to diaply like"record is deleted and it will be in recyclebin for 30 days"
 
How I can show this meesage instead of standard message in visual force page?
 
Any help will be great.
Hi,

I have created a VF page with custom extension in which I will be taken to a new page when I click a "Attach File"
button.

My problem is once I am taken to new page , I want to check a condition before I save the file. So I want to overrde the "Attach File" button in Save page of Notes and Attachment section . Is that possible ?

I can not write a VF page for  the rendered page ..so how can I overwrite the button?

Thanks,
Sirisha

Hi,

I have an object and I allow the user to update the object only before some deadline. My problem is I wrote a trigger
which restricts the update of the object based on the deadline. But the relatedlists of the object get updated even after the
deadline.

One of my related lists is Notesandattachments . I was able to add attachments even after the deadline. Is there a way to restrict the update of attachments ?

Kindly help.

Thanks,
Sirisha

Hi

I have written this following piece of code for invoking controller method from Javascript but it does not work. I am not sure what I am missing in it,
Code:
<apex:outputPanel rendered="{!contractSummary}">
            <p><span style="padding:100px;"></span><apex:commandButton action="{!viewContractSummary}" value="View Contract Summary" styleClass="btn"/>
            <span style="padding:5px;"/><apex:commandButton value="Remove Term" onclick="validateRemove()"></apex:commandButton></p>
              <apex:actionFunction name="removeContractTerms" action="{!removeContractTerms}"></apex:actionFunction>
            <script>
                function validateRemove()
                {
                    var answer = confirm("Would you like to remove this Term from the Contract—")
                    if(answer)
                    {
                      var contractTermsId = document.getElementById('{!$Component.contractTermsId}')
                      removeContractTerms()
                    
                    }
                    else
                    {
                        alert("No"+contractTermsId)
                    }
                
                }
            </script>
       </apex:outputPanel>


Controller
 public PageReference removeContractTerms()
       {     
           delete contract_terms;
           return viewContractSummary();
           
       
       }  

  /* This method takes the user to the contract summary page */
       public PageReference viewContractSummary()
       {
        
            PageReference contSumPr = Page.contract_summary;
            contSumPr.getParameters().put('contractId', System.currentPageReference().getParameters().get('contractId'));
            contSumPr.setredirect(true);
            return contSumPr;
        
       }

 I tried both ways to call the Controller method - using the apex:actionFunction Name directly and also by using setTimeout(removeContractTerms,1000)

Can  anyone please look into this?

Thanks
Jina

Hi,

I wrote a "before insert"  trigger for finding duplicates in my custom object and I also wrote a VF page for the same object.
My VF page has a custom extension.

Even though trigger does not allow the duplicates but it does not display the error message on VF page
.Do I need to change anything in page to display the errors ?

Thanks,
Sirisha
Hi,

I want to change the header name of a page I created . I used PageReference to create the page using the URL.
Can anybody please tell me how to change the header of a page ?

Thanks,
Sirisha

Hi,

I created a button with different name for "New Note" under the Notes and Attachments section. My problem is
In the action method for the button when I copy the parent_id using

secondPage.getParameters().put('parent_id',exmsub.Id);

--it copies 18 bit record id an displays the "Data not available " error

but if I remove the last 3 bits of the record-id manually , it displays the page properly.
How do I supply only 15 bit record id for the record I am displaying.

This problem did not arise when I was renaming the Attach File button.

Can anybody tell me where  I am going wrong?

Thanks,
Sirisha
Hi,

All of a sudden my S-control started giving "Insufficient privileges" error message , even though I am the administrator.
Did any thing chane regarding the S-control ?

I am actually displaying the S-control using the following code

Code:
<apex:tab label="WhiteBoard" name="WhiteBoard" id="tabWB">
<apex:scontrol controlname="Whitecanvas" subject="Whitecanvas" width="800" height="600"/>
</apex:tab>

 


Sirisha

Hi,

I have a query regarding the Notes & Attachments.
I want to remove "New Note" button or atleast rename it to something which is relevant to my application. Is this possible ? If not, any ideas of how to implement a button which has the functionality of the "Attachment"  button.

Thanks
Sirisha
Hi,

I wrote a VF page using the same yahoo tool bar used in blog application.
 
My page is sometimes loading properly sometimes it is not.

This is the code I used:
Code:
<apex:page showHeader='true' standardcontroller="Assignment__c">
<apex:form>
<apex:pageBlock>
<!-- Skin CSS file -->
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/skin.css" ></link>

<!-- Utility Dependencies -->
<script src="http://yui.yahooapis.com/2.3.0/build/utilities/utilities.js"></script>

<!-- Needed for Menus, Buttons and Overlays used in the Toolbar -->
<script src="http://yui.yahooapis.com/2.3.0/build/container/container-min.js"></script>
<script src="http://yui.yahooapis.com/2.3.0/build/menu/menu-min.js"></script>
<script src="http://yui.yahooapis.com/2.3.0/build/button/button-beta-min.js"></script>

<!-- Source file for Rich Text Editor-->
<script src="http://yui.yahooapis.com/2.3.0/build/editor/editor-beta-min.js"></script>



<div class="yui-skin-sam" style="display:none" id="editor" align="center" ><p />
<h2>Assignment Description </h2>
<apex:pageBlockSection>
<apex:inputField value="{!Assignment__c.Course__c}" />
<apex:inputField id="Duedate" value="{!Assignment__c.Due_Date__c}" />
</apex:pageBlockSection>

<apex:inputtextarea id="Description" cols="500" rows="50" value="{!Assignment__c.Description__c}"/>
<apex:commandButton value="Save" action="{!Save}" onClick="beforeTextSave()"/>
<p />
</div>


<script type="text/javascript" >
var myEditor;
window.onload = function init() {
myEditor = new YAHOO.widget.Editor('{!$component.Description}', {
height: '400px', width: '722px', dompath: true, animate: true });
myEditor.render();
document.getElementById('editor').style.display='';
}
function beforeTextSave() {
document.getElementById('{!$component.Description}').value = myEditor.getEditorHTML();
}

</script>
</apex:pageBlock>
</apex:form></apex:page>

 
where Assignment is my custom object,
 Description,duedate are custom fields

Can anybody please tell me whats wrong in the code ?

Thanks,
Sirisha
Hi ,

I am using a yahoo text editor( similar to the blog application example in visualforce) to edit one textarea field.
But when I save and it does not show the data in the format .

For example when  I print text in italics
it prints <i> your text </i>

I know it is some style sheet problem. Does anyone know which style sheet to use to display formatted text ?

Thanks,
Sirisha
Hi

Is there a way to block the look up window ? I am using the <inputField> in Visualforce page for a lookup field but I dont want user to see the various values for that filed. (Say for eg Student Id) .


Thanks,
Sirisha