• shippu
  • NEWBIE
  • 5 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
Hi ,
 I'm trying to debug using eclipse with apex debuggger. But facing below issue.
Can some one pls guide me how to solve this.

User-added image


Thanks,
Naveen

I am having trouble attaching an ajax event to a multi-picklist.

I want to display the text field Case.Other_Categories__c if and only if if "Other" is selected in the multi-picklist Case.Categories__c.

public Boolean displayOther { get { return theCase.Categories__c != null && theCase.Categories__c.contains('Other'); } }

 

 

 

<apex:pageBlockSection> <apex:actionregion immediate="true"> <apex:inputField value="{!Case.Categories__c}"> <apex:actionSupport event="onblur" rerender="other_categories" status="updating_other_status"/> </apex:inputField> </apex:actionregion> <apex:inputField value="{!Case.Other_Categories__c}" rendered="{!displayOther}" id="other_categories"/> <apex:actionStatus startText="updating..." id="updating_other_status" /> </apex:pageBlockSection>

 

I've tried onclick, onchange, ondblclick, and onblur events, but I never see the actionstatus displayed, and watching in firebug I never see an ajax submit.

 

 

Is there a trick to this?

Hey Guys new to VF and having some problems,

 

here' what I want to do, and I currently cannot find any way of doing this:

 

I have a repeat tag that populates a few fields from a list.

each iteration displays the record's name and 2 2 pickList values (which I want to the user to be able to change via a selectList)

 

 

For each iteration I would like the selectList to display the current pickList value the record holds, instead of being in alphabetical order.

 

Ultimately I want the user to be able to update each of these records pickList fields based on the current value of the selectLists. 

 

Currently the selectLists simply hold all values in the pickList field and when the 'save' button is pushed, the selectList values aren't referenced and the pickList fields remain the same.

 

How can I make it so the selectList displays the records original pickList values first and then the rest of the pickList var's so that on save I can reference each records selectList value and update that record.

 

Also would I be able to make the ID for a pageBlocksection (which resides within thet repeat tag) based on a value retrieved in the repeat process?  this way I can grab the selectList values from each record dynamically no matter how many records I display.

 

I apologize for the length of my question and hope someone can help!

 

Page:

 

<apex:page standardController="Speaker_Bureau_Membership_gne__c" showheader="false" sidebar="false" extensions="em3_bureau_nomination_ctrlr"> <!-- <div class="ptBody secondaryPalette"><div class="content"><img src="/s.gif" alt="Speaker Bureau Membership" class="pageTitleIcon" title="Speaker Bureau Membership"><h1 class="pageType noSecondHeader">Bureau Nomination</h1><div class="blank">&nbsp;</div></div><div class="links"><a href="javascript:printWin('/a2x/x?fcf=00BQ0000000TXDw&amp;rpp_sticky=false')" class="configLinks" title="Printable View (New Window)">Printable View</a> | <a href="javascript:openPopupFocusEscapePounds('/help/doc/user_ed.jsp?loc=help&amp;target=co_view.htm&amp;section=CustomObjects', 'Help', 700, 600, 'width=700,height=600,resizable=yes,toolbar=yes,status=no,scrollbars=yes,menubar=yes,directories=no,location=no,dependant=no', false, false);" title="Help for this Page (New Window)"><span class="helpLink">Help for this Page</span><img src="/s.gif" alt="Help" class="helpIcon" title="Help"></a></div></div><div class="ptBreadcrumb"></div> --> <apex:pageBlock id="theIDs" > <apex:pageBlockButtons > <apex:form > <!-- <apex:commandButton action="{!nominate}" value="Nominate Speakers"/> <apex:commandButton action="{!cancel}" value="Cancel" onClick="window.top.close();"/> <apex:actionFunction name="Nominate" action="{!nominate}" id="out" status="myStatus" onComplete="window.close();"/> --> <apex:commandButton id="nominate" value="Nominate Speakers" action="{!nominate}" onComplete="parent.window.opener.location.reload(); window.close();" /> <apex:commandButton value="Cancel" onClick="window.close();"/> <apex:commandButton value="View IDs" action="{!setID}" reRender="status" /> </apex:form> </apex:pageBlockButtons> <apex:Repeat value="{!members}" var="m"> <apex:param name="mName" value="test" /> <apex:pageBlock > <apex:form > <apex:facet name="header"><b>{!m.name}</b></apex:facet> <apex:pageBlockSection title="{!m.name}" collapsible="false" columns="3"> <apex:outputField value="{!m.Bureau_Member_gne__c}" /> <apex:pageBlockSectionItem > <apex:outputLabel value="Spaker Bureau" for="speaker_bureau"/> <apex:selectList value="{!selected_option}" multiselect="false" size="1" id="speaker_bureau"> <apex:selectOptions value="{!Bureaus}"/> </apex:selectList> </apex:pageBlockSectionItem> <apex:inputField value="{!m.Speaker_Scope_gne__c}" /> </apex:pageBlockSection> </apex:form> </apex:pageBlock> </apex:Repeat> </apex:pageBlock> <apex:pageBlock id="status"> <apex:outputText value="{!ID}" /> </apex:pageBlock> </apex:page>

 

 Controller:

 

public class em3_bureau_nomination_ctrlr { private List<String> myList = new List<String>(); private List<SelectOption> options = new List<SelectOption>(); private List<Speaker_Bureau_Membership_gne__c> myMembers = new List<Speaker_Bureau_Membership_gne__c>(); private String selected_option; private List<Speaker_Bureau_gne__c> myBureaus = new List<SPeaker_Bureau_gne__c>(); private static List<Speaker_Bureau_Membership_gne__c> members = new List<Speaker_Bureau_Membership_gne__c>(); private Map<ID,Speaker_Bureau_Membership_gne__c> ID_to_members_map = new Map<ID,Speaker_Bureau_Membership_gne__c>(); private String IDs; public em3_bureau_nomination_ctrlr(ApexPages.StandardController controller){ reset(); myList = new Map<String,String>(ApexPages.currentPage().getParameters()).values(); setMembers(); setBureaus(); } public void reset(){ myList.clear(); options.clear(); myMembers.clear(); selected_option = null; myBureaus.clear(); members.clear(); ID_to_members_map.clear(); IDs = null; } public void setID(){ IDs +=System.CurrentPageReference().getParameters().get('mName')+','; } public string getID(){ return IDs; } public List<SelectOption> getBureaus(){ options = new List<SelectOption>(); for(Speaker_Bureau_gne__c sb : myBureaus ){ options.add(new SelectOption(sb.Name,sb.Name)); } return options; } public void setBureaus(){ myBureaus = [select ID, Name from Speaker_Bureau_gne__c]; } //For some reason the members variable in this method has a double of every member when it gets to this function. //so if members originally had 2 membership records in the list, it would have 4 in this method. No idea why. Fixed this by making //the members variable static - unclear as to why that helped but logic behind making it static was to have it keeps it's value and not //be refreshed upon instantiation of the controller public void nominate(){ List<Speaker_Bureau_Membership_gne__c> nominations = new List<Speaker_Bureau_Membership_gne__c>(); for(Speaker_Bureau_Membership_gne__c membership : members){ nominations.add(new Speaker_bureau_membership_gne__c( User__c = Membership.User__c, Speaker_Status_gne__c = 'Nominated', Speaker_Scope_gne__c = membership.Speaker_Scope_gne__c, Speaker_Bureau_ID_gne__c = membership.Speaker_Bureau_ID_gne__c, Nomination_Date_gne__c = System.now(), Nominated_By_gne__c = UserInfo.getUserID(), Bureau_Member_gne__c = membership.Bureau_Member_gne__c )); } try{ insert(nominations); }catch(DmlException e){ System.debug(e.getMessage()); } } public void setselected_option(String t){ } public String getselected_option(){ return null; } /*public pageReference cancel(){ //https://cs3.salesforce.com/a2x/o //PageReference pageRef = new PageReference('/a2x/o'); //pageRef.setRedirect(true); //return pageRef; }*/ public void setMembers(){ myMembers = [select ID,User__c, Name,Speaker_bureau_id_gne__c,Bureau_Member_gne__c,Speaker_scope_gne__c from Speaker_Bureau_Membership_gne__c]; createMap(myMembers); } public void createMap(List<Speaker_Bureau_Membership_gne__c> theMembers){ for(Speaker_Bureau_membership_gne__c current_member : theMembers){ if(!ID_to_members_map.keySet().contains(current_member.id)){ ID_to_members_map.put(current_member.id,current_member); } } } public List<Speaker_Bureau_Membership_gne__c> getMembers(){ for(String memberID : myList){ ID temp = memberID; members.add(ID_to_members_map.get(temp)); } return members; } public void setList(ID text){ if(text != null){ myList.add(text); } } public List<String> getList(){ return myList; } }

 

 

 

 

  • May 08, 2009
  • Like
  • 0