+ Start a Discussion
enTran01enTran01 

apex param not passing to my controller.

im trying to pass parameters to my controller. But not luck so far. i have tried putting the values in an outputpanel and rerendering the panel and still its not passing the values.

 

<apex:column id="feedColumn" >
             
                                        
                 <apex:facet name="header">Feeds</apex:facet>
                 
                    
            	 <apex:param name="FeedId" value="{!feed.feedId__c}" assignTo="{!commentId}"></apex:param>
            	 
            	   
                        <apex:outputPanel styleClass="invisiblePanel" id="jsvalues">
                             <apex:outputText value="Value one: {!feed.feedId__c}" /><br/>
                             <apex:outputText value="Value two: {!commentBody}" /><br />
                             <apex:outputText value="Value three: {!feedLikeId}" /><br /> 
                              <apex:outputText value="Value four: {!commentId}" /><br />             
                      </apex:outputPanel>
                 
                                 
                    
                  
                    <apex:form id="commentForm" >
                        
                        <apex:outputLabel id="like" style="padding-right:20px;color:#0000FF;" value="Like" onclick="changeLike('{!$Component.chatterFeed.feedTable.commentForm.like}')"  >
                         
                          <apex:actionSupport event="onclick" action="{!mobileLike}" reRender="jsvalues">
                           <apex:param id="feedLikeId" value="{!feed.feedId__c}" assignTo="{!feedLikeId}" name="feddLikeid"></apex:param>
                          </apex:actionSupport>
                        </apex:outputLabel>                        
                      
                     
                        
                    </apex:form>
                    
              </apex:column>

 

 

jwetzlerjwetzler

The main issue you're having is that actionSupport is trying to attach an onclick event to a component that already has onclick specified.

 

But I would also strongly suggest that you not have a form inside of a column, as that's going to duplicate your form for every row in your column, which might give you some viewstate issues down the line. You shouldn't really need more than one form on your page.

 

Your main issue is your onclick attribute on outputLabel. You can use onsubmit or oncomplete in your actionSupport component to run any javascript that needs to be run in conjunction with your param assignment.

enTran01enTran01

Thanks for those suggestions. I will take your word on the forms. I changed the code so im not using actionsupport.anymore, instead im using commandButton to perform that action but Im still having the same issue.

 

   <apex:commandButton style="margin-left:95px;" value="Comment" action="{!mobileComment}" >                              
                                <apex:param name="FeedId" value="{!feed.feedId__c}" assignTo="{!commentId}"></apex:param>
                              
                        </apex:commandButton>


<apex:outputLabel id="comLinkLabel" style="padding-right:10px;color:#0000FF;" value="Comment" onclick="MyCommentIds('{!$Component.chatterFeed.feedTable.theCommentForm}','{!$Component.chatterFeed.feedTable.commentForm.comLinkLabel}');" ></apex:outputLabel>