Titanium JIRA Archive
Alloy (ALOY)

[ALOY-788] iOS: rightButton for TextField doesn't work

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-11-06T21:19:44.000+0000
Affected Version/sAlloy 1.2.1
Fix Version/sAlloy 1.3.0, 2013 Sprint 23
Componentsn/a
Labelsalloy, rightbutton, textfield
ReporterDaniel Sefton
AssigneeTony Lukasavage
Created2013-08-10T08:46:00.000+0000
Updated2014-06-22T13:21:17.000+0000

Description

*Problem* rightButton for TextField doesn't work. XML structure has to look like the following (Similar like a HeaderView under a TableView): *Alloy test case*
 
<Alloy>
  <Window> 
    <TextField>
      <RightButton>
        <Button />
      </RightButton>
    </TextField>
  </Window>
</Alloy>
*Error*
Invalid method (createRightButton) passed to UIModule
*Note* Yes we can use a workaround, but I have to use a controller for this and it's a mess. *Standard test case*
var win = Ti.UI.createWindow({
	backgroundColor : 'white'
});

var rightButton = Titanium.UI.createButton({
	color : '#FF0000',
	title : 'Hello'
});

rightButton.addEventListener('click', function() {
	alert("rightButton clicked");
});

var textField = Ti.UI.createTextField({
	borderStyle : Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
	color : '#336699',
	top : 10,
	left : 10,
	width : 250,
	height : 40,
	rightButton : rightButton
});

win.add(textField);
win.open();

Comments

  1. Daniel Sefton 2013-08-15

    Tested and confirmed on iOS 6 simulator with Ti SDK 3.1.1 GA and Alloy 1.2.1. Simply drop in the XML to the default view in a new Alloy project and run it. @Tony: It looks like a feature request for the Alloy XML to me. I'm going to assume that doing isn't supported by Alloy. I also created a standard test case just encase, which works.
  2. Tony Lukasavage 2013-11-06

    Resolved as part of ALOY-418. Additional details and testing measures can be found in there.
  3. Federico Casali 2013-12-10

    See ALOY-418 for resolution. Closing.

JSON Source