Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14466] DocumentViewer: Cannot set show method's view param to a Ti.UI.View (non-ButtonBarItem)

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2017-06-14T20:14:06.000+0000
Affected Version/sRelease 3.1.1
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterBenjamin Hatfield
AssigneeEric Merriman
Created2013-07-02T18:18:36.000+0000
Updated2017-06-14T20:14:06.000+0000

Description

ENVIRONMENT: Mac OS X 10.7.5 TiSDK 3.1.1.GA Appcelerator Studio, build: 3.1.1.201306131423 Xcode Version 4.6.2 (4H1003) iOS 6.1 REPRODUCTION: Run the following code below in the iPad simulator. May need to add a doc in the Resources folder to preview and modify line 53 to point to the document. Click the right nav button or the button in the toolbar at the bottom. Options menu pops up as expected and is anchored to the button. Click the button in the window. The options menu does not appear, but the menu event is triggered. Click on the label, button bar or orange view. The options menu appears and anchored to the view component, but the view component moves to the top-left corner. EXPECTED RESULTS: When clicking these items, the options menu should appear anchored to the view component and should not move the view component from its set position. MORE INFO: On the iPhone simulator, the options menu appears as a dialog, but still moves the label, buttonbar and view. Does not appear for the button in the window. Works fine for the toolbar and right nav button.
var win2 = Ti.UI.createWindow();
var navGroup = Ti.UI.iPhone.createNavigationGroup({window: win2});
var navButton = Titanium.UI.createButton({title:'Launch'});
win2.RightNavButton = navButton;
var winButton = Titanium.UI.createButton({
    title:'Launch',
    height:40,
    width:200,
    top:270
});
winButton.addEventListener('click', function(){docViewer.show({view:winButton, animated: true});});
win2.add(winButton);


var buttonbar = Titanium.UI.createButtonBar({
    labels:['One', 'Two', 'Three'],
    backgroundColor:'#336699',
    top:50,
    style:Titanium.UI.iPhone.SystemButtonStyle.BAR,
    height:25,
    width:200
});
buttonbar.addEventListener('click', function(){
	docViewer.show({view:buttonbar, animated: true});
});
win2.add(buttonbar);

var send = Titanium.UI.createButton({
    title: 'Send',
    style: Titanium.UI.iPhone.SystemButtonStyle.DONE,
});
send.addEventListener('click', function(){
	docViewer.show({view:send, animated: true});
});
var toolbar = Titanium.UI.iOS.createToolbar({
    items:[send],
    bottom:0
}); 
//win2.titleControl = toolbar;
win2.add(toolbar)

var view = Ti.UI.createView({
    height:40,
    width:200,
    top:200,
    backgroundColor: 'orange'
})
view.addEventListener('click', function(){
	docViewer.show({view:view, animated: true});
});
win2.add(view);

docViewer = Ti.UI.iOS.createDocumentViewer({url:'Example.pdf'});
navButton.addEventListener('click', function(){
	docViewer.show({view:navButton, animated: true});
});

var label = Ti.UI.createLabel({text: 'The options menu sucks.', color: 'white'});
label.addEventListener('click', function(){
	docViewer.show({view:label, animated: true});
});
win2.add(label);



docViewer.addEventListener('unload', function(e){Ti.API.info(JSON.stringify(e));});
docViewer.addEventListener('load', function(e){Ti.API.info(JSON.stringify(e));});
docViewer.addEventListener('menu', function(e){Ti.API.info(JSON.stringify(e))});

var win1 = Titanium.UI.createWindow();
win1.add(navGroup);
win1.open();

Comments

  1. Lee Morris 2017-06-14

    Closing ticket due to time passed and lack of progress in the past few years. Any problems, please file a new ticket.

JSON Source