• Jorge Esparza 4
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
I have a very simple <ui:inputSelectOption> element and a button that calls a controller action that examines the element's label and value. However, the label is "undefined" on the select element.
 
<ui:inputSelect aura:id="pricebooks">
    <ui:inputSelectOption text="" label="--None--" />
    <aura:iteration items="{!v.pricebooks}" var="pricebook">
        <ui:inputSelectOption text="{!pricebook.Id}" label="{!pricebook.Name}" />
    </aura:iteration>
</ui:inputSelect>

<button onclick="{!c.selectPricebook}">Select</button>

Controller code:
({
    selectPricebook: function(component, event, helper) {
        var selectCmp = component.find("pricebooks");
	var value = selectCmp.get("v.value");
        console.log(value); // The expected result
        var label = selectCmp.get("v.label");
        console.log(label); // undefined
})

I've examined the selectCmp object in the debugger and the label property is, in fact, "undefined". What could be the problem here?

Hi everyone,

 

I have two visualforce pages whose name are "PageTransition" and "nextPage".

They share the same custome controllear of which is "PT".

I use setRedirect(false) because I want to share several same parameters in transition from "PageTransition" to "nextPage".  

But setRedirect(false) doesn't work !

 

Here is PageTransition.

<apex:page controller="PT" action="{!nextPage}" sidebar="false"> <!-- Begin Default Content REMOVE THIS --> <h1>Congratulations</h1> This is your new Page: PageTransition <!-- End Default Content REMOVE THIS --> </apex:page>

 

Here is nextPage.

<apex:page controller="PT" tabStyle="PageTransition__tab" sidebar="false"> test0 is {!test0}<br/> test1 is {!test1}<br/> test2 is {!test2}<br/> </apex:page>

 

Here is the controller method.

public class PT { public String test0 { get; set; } public String test1 { get; set; } public String test2 { get; set; } public PageReference nextPage() { test0 = 'aaa'; test1 = 'bbb'; test2 = 'ccc'; PageReference np = Page.nextPage; np.setRedirect(false); return np; } }

 

 

Tab name is "PageTransition".