• gliu
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 6
    Replies

I'm having a problem when i try to rerender a specific pageblock section as opposed to the entire page. Here's a snippet of the code:

 

The idea is that I only want a specific section to show, when certain criteria are met. So on the onchange event, i want to rerender that specific pageblock section. But it's not working correctly. It works if i try to rerender the entire page. But i can't do that because then i loose all the values that have been input into all the fields on the form. Any ideas on what i'm doing wrong?

 

 

<apex:page standardController="case" sidebar="false"> <apex:sectionHeader title="Sponsor: {!$User.FirstName} {!$User.LastName}" subtitle="New Badge Request" /> <apex:form > <apex:pageBlock title="Edit Case" id="thePageBlock" mode="edit"> <apex:actionRegion > <apex:pageBlockSection title="Initiation Information" columns="1" collapsible="false" > <apex:pageBlockSectionItem > <apex:outputLabel value="Is Initiation Required for this Applicant?"/> <apex:outputPanel > <apex:inputField value="{!case.E_Initiation_Required__c}" required="true"> <apex:actionSupport event="onchange" rerender="something" status="status2"/> </apex:inputField> <apex:actionStatus startText="Updating required fields..." id="status2"/> </apex:outputPanel> </apex:pageBlockSectionItem> </apex:pageblocksection> </apex:actionRegion> <apex:pageBlockSection id="something" rendered="{!case.E_Initiation_Required__c == 'Yes'}"> <apex:inputField value="{!case.Requesting_Organization__c}" /> <apex:inputField value="{!case.Sub_Agency__c}" /> <apex:inputField value="{!case.Region_Num__c}" /> <apex:inputfield value="{!case.Central_Office__c}" /> <apex:inputField value="{!case.Applicant_s_Supervisors_Name__c}" /> <apex:inputField value="{!case.Applicant_s_Supervisor_Phone_Number__c}" /> </apex:pageBlockSection>

 

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

 

 

 

 

For the Note & attchment Related Link, it possiblt to remove Attach File button?

Or have any idea or suggestion not let the user to attach the file?

 Thanks.

 

Best Regrds:

May

There must be something subtle I'm missing here. Component documentation states that attributes in custom components can be custom types, yet, the component (snippet) below simply refuses to acknowledge a public method in a custom type. The attribute in red below gives a null pointer exception. If I call the "getter" directly, it doesn't recognize the method name.

 

Ideas, folks? Oh, and the reason I need this is I'm testing out ways to write my own object layouts, since Apex doesn't have access to layout info (yet).

 

Thanks!

Grant

 

public class CaseLayout {

public List<ApexPages.Action> m_actions;

public List<ApexPages.Action> getM_actions() {
if (m_actions == null) {
m_actions = new List<ApexPages.Action>();
m_actions.add(new ApexPages.Action('{!Save}'));
m_actions.add(new ApexPages.Action('{!Case.Edit}'));
}
return m_actions;
}

public void setM_actions(List<ApexPages.Action> actions) {
m_actions = actions;
}
}

 

 

 

<apex:component>
<apex:attribute name="case" description="Incoming case object" type="Case"/>
<apex:attribute name="layout" description="Incoming Case Layout object" type="CaseLayout"/>
<apex:form >
<apex:pageBlock title="{!$ObjectType.case.label}">
<apex:pageBlockButtons >
<apex:repeat value="{!layout.m_actions}" var="v_action">
<apex:commandButton action="{!URLFOR(v_action)}" value="Edit"/>
</apex:repeat>

 

etc

etc

 

Reference message:
 
I can't display a Histories related list in a VF page.  I used Ron Hess's method of using a pageBlock to get the related list items except one, "Field" (i.e. without the last column in the code below, the VF page displays without an error message).  The error message in the Subject is what is created when I try and access that field.  The WDSL has
 
 <element name="Field" nillable="true" minOccurs="0" type="xsd:string" /> 
 
Code:
<apex:pageBlockTable value="{!SCRB_SalesOrder__c.Histories}" var="h">
      <apex:column headerValue="Date" value="{!h.createddate}"/>
      <apex:column headerValue="User" value="{!h.CreatedById}"/>
      <apex:column headerValue="Action" value="{!h.Field}"/>
</apex:pageBlockTable>


 The normal View page displays the following after I created the record and then I made a change to the "Status Code" field.

DateUserAction
9/18/2008 7:04 PM    xxxxxxxxxxx   Changed Status Code from Draft to Pre-build.
9/13/2008 2:22 PM    xxxxxxxxxxx  

   Created.

The VF page generated the following error messages:
After the record was created:
Changed Field: bad value for restricted picklist field: created
 
Here is another error message on the VF page when "Status Code" field was changed:
Changed Field: bad value for restricted picklist field: StatusCode__c

Thanks for any help.