• SF Max
  • NEWBIE
  • 14 Points
  • Member since 2014
  • Developer
  • SMB Helpdesk

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies
I have a couple custom lightning pages and apps, both overriding default record views and standalone pages (just straight nav to from the sidebar). It seems that everytime we go from 'tab' to 'tab' it just hides the content rather than destroying it. When you navigate back to the tab, it does recreate the components, so you end up with 2 of everything sitting out there.

I noticed this b/c we have a component that registers to an app event. And everytime you navigate away from and back to the page, the handler is registered +1. So going back and forth a few times you pretty quickly have 10s of the same handlers firing for each app event.

Anyone seen this? Thoughts?
 
  • August 24, 2016
  • Like
  • 0
Has anyone come across this issue:

1. Create a custom object with mulit-select picklist
2. Create a page with docType="html-5.0" and the standardController for that object
3. Create inputfield for the multi-select field
4. Select one of the options. Submit the form - will fail asking you to select a value.

Issue is the attribute added to the select: required="required"

Here is the VF mark up i used in my org:

<apex:page standardController="CUSTOM__C" sidebar="false" standardStylesheets="false" docType="html-5.0" >

<apex:form >
<apex:inputField value="{!CUSTOM__C.Multi__c}" required="true"/> 
<apex:commandButton value="save" action="{!save}"/>
</apex:form>



</apex:page>
The rendered html has each of the toss accross multi selects marked with required="required" which (chrome at least) prevents the form from submitting, because it's looking at each <Select> as a form control.
  • September 12, 2014
  • Like
  • 0
I have a couple custom lightning pages and apps, both overriding default record views and standalone pages (just straight nav to from the sidebar). It seems that everytime we go from 'tab' to 'tab' it just hides the content rather than destroying it. When you navigate back to the tab, it does recreate the components, so you end up with 2 of everything sitting out there.

I noticed this b/c we have a component that registers to an app event. And everytime you navigate away from and back to the page, the handler is registered +1. So going back and forth a few times you pretty quickly have 10s of the same handlers firing for each app event.

Anyone seen this? Thoughts?
 
  • August 24, 2016
  • Like
  • 0
I am trying to implement an onclick listener that will take the div clicked and get the data-id from the element and call an apex method with it.
Here is my code snippet.
<aura:iteration var="convo" items="{!v.conversations}">
                <a href="#" data-id="{!convo.Id}" onclick="{!c.fireAppEvent}" style="text-decoration:none;">
                <div class="{!convo.ReadFlag__c == 	True ? 'slds-box slds-no-flex
 slds-theme--shade' : 'slds-box slds-no-flex slds-theme--default'}" >
                    <li class="slds-list__item">
                        <div class="slds-media slds-tile">
                            <div class="slds-media__figure">
                                <img src="/resource/SLDS100/assets/images/avatar2.jpg" style="height:60px;" alt="Placeholder" />
                            </div>

                            <div class="slds-media__body ">
                                <p class="slds-tile__title slds-truncate">
                                    {!convo.Name}
                                </p>
                                <ul class="slds-tile__detail slds-list--horizontal slds-has-dividers slds-text-body--small">
                                    <li class="slds-truncate slds-list__item">From : {!convo.FromNumber__c}</li>
                                    <li class="slds-truncate slds-list__item">To : {!convo.ToNumber__c}</li>
                                </ul>

                                <div class="{!convo.ReadFlag__c == True ? 'slds-media__body slds-text-body--regular' : 'slds-media__body slds-text-header--small'}">
                                    <p class="slds-truncate">{!convo.Messages__r[0].MessageText__c}</p>
                                    <p>{!convo.Messages__r[0].Direction__c == 'TOSF' ? 'Received at' : 'Sent at'} : {!convo.Messages__r[0].Time__c}</p>
                                </div>
                            </div>
                        </div>
                    </li>
                </div>
               </a>     
            </aura:iteration>
fireAppEvent : function(cmp, event) {
        var appEvent = $A.get("e.c:ConversationEvent");
        var convoId = event.target.getAttribute("data-id");
        console.log(event.target);
        console.log(convoId);
        appEvent.setParams({
            "message" : convoId });
        appEvent.fire();
    },

The problem is that it uses the element that I clicked on instead of the div that I set the onclick to. By that I mean if I click on the text part of the div, the event.target is the <p> tag, if I click on the image, the event.target is the  <img> tag, but what I want is for it to always get the data from the original <div> tag. 
 

How can I go about doing this?

Has anyone come across this issue:

1. Create a custom object with mulit-select picklist
2. Create a page with docType="html-5.0" and the standardController for that object
3. Create inputfield for the multi-select field
4. Select one of the options. Submit the form - will fail asking you to select a value.

Issue is the attribute added to the select: required="required"

Here is the VF mark up i used in my org:

<apex:page standardController="CUSTOM__C" sidebar="false" standardStylesheets="false" docType="html-5.0" >

<apex:form >
<apex:inputField value="{!CUSTOM__C.Multi__c}" required="true"/> 
<apex:commandButton value="save" action="{!save}"/>
</apex:form>



</apex:page>
The rendered html has each of the toss accross multi selects marked with required="required" which (chrome at least) prevents the form from submitting, because it's looking at each <Select> as a form control.
  • September 12, 2014
  • Like
  • 0