Smartface add searchbar to actionbar - smartface.io

I want to add searchbar in actionbar. I don't know how to do this. Can you show me an example code. Maybe this code may be incorrect.
srcBar = new SMF.UI.SearchBar({
width:"100%",
height:"10%",
left:"0%",
top:"20%",
icon:"arama_icon.png",
setShowsCancel : true,
text:""
});
this.actionBar.menuItems = [srcBar];

I solved this problem. We need to use actionView for android and stickToNavigationBar for iOS.
var srcBar = new SMF.UI.SearchBar({
width:"100%",
height:"10%",
left:"0%",
top:"20%",
icon:"arama_icon.png",
setShowsCancel : true,
text:"",
actionView:true,
stickToNavigationBar:true,
fontColor:"white"
});
Pages.FrmGoruntuleme.add(srcBar);

Related

Not able to toggle ui5 button

new sap.m.Button("manualimage",{
icon : 'resources/Green.JPG',
width : "40px",
height : "40px",
press :function(e) {
var myBtn = sap.ui.getCore().byId("manualimage");
console.log(document.getElementById("manualimage").icon);
myBtn.setIcon('');
}
})
When I click on the button the Icon is not changing, any suggestions what I might be doing wrong here?
Below is my code which is working ( on UI5 version 1.42).
I only find one mistake : You should use ToggleButton to keep the state of Button. Say remove image if pressed or set image back when pressed back ( ie. not pressed).
Code in XML :
<ToggleButton icon='./images/ICICI.png' text ='hey' pressed='false' press='handlePress' />
Code in Controller:
handlePress: function(evt) {
var oSource = evt.getSource()
var bPressed = oSource.getPressed();
if(bPressed) {
oSource.setIcon('');
} else {
oSource.setIcon('./images/ICICI.png');
}
}
Let me know if this works for you.
When you use:
var myBtn = sap.ui.getCore().byId("manualimage");
your var myBtn is undefined, because using sap.ui.getCore() id of button is expecting something like:
sap.ui.getCore().byId("__xmlview1--manualimage");
where __xmlview1-- is autogenerated by framework. So please use this code instead:
var myBtn = this.byId("manualimage");

setSelectedButton & setSelectedKey for segmented button

hey guys not sure if this is a bug or theres something I'm doing wrong, or the CSS style sheets im using are making this error, but im racking my brain on how to fix this.
I have the following code bellow in a loop, ever since I put it in a loop it no longer works as setting the selected button I had a search and some one said try set selected key, I also tried this and no luck. Now I have put them both in and it sets the selected value to neither button. I'll show you screenshots of what I mean. Any ideas on fixing it would be great.
for(var i = 0; i < results.length; i++) {
//Create buttons dynamically
var segmentItemYes = new sap.m.SegmentedButtonItem({text :"Yes", press: [this.onSEYesPress, this]});
var segmentItemNo = new sap.m.SegmentedButtonItem({text :"No", press: [this.onSENoPress, this]});
var segmentedButton = new sap.m.SegmentedButton({items : [segmentItemYes, segmentItemNo]});
//TODO:Doesn't work currently - How do we set default state?
segmentedButton.setSelectedButton(segmentItemNo);
segmentedButton.setSelectedKey(segmentItemNo);
Below is the Image the top part is what I'm getting (I clicked on no to show you what exactly happens. The bottom one is with the setSelectedKey removed but still set to no. any ideas? This is in a JS controller and it gets placed in to an xml fragment if this makes a difference or not.
I got it to work as follows, by binding the selected key to a model:
var segmentItemYes = new sap.m.SegmentedButtonItem( {
text: "Yes",
key: "foo"
});
var segmentItemNo = new sap.m.SegmentedButtonItem( {
text: "No",
key: "bar"
});
var segmentedButton = new sap.m.SegmentedButton( {
items: [segmentItemYes, segmentItemNo],
selectedKey: {
path: "test>/key"
}
});
var model = new sap.ui.model.json.JSONModel({
key: "bar"
});
sap.ui.getCore().setModel(model, "test");

Bing Maps AJAX Control 7.0 - how can I turn off street labels in Bird's Eye view?

I use Bing Maps AJAX Control 7.0 ISDK.
I would like to turn off the street labels in Bird's Eye view.
The question has been asked but for the api 6
I can do it with the navigation bar.
But the navigation bar is off on my map :
showDashboard: false
I don't find any solution on the sdk :
http://www.bingmapsportal.com/isdk/ajaxv7#CreateMapWithViewOptions7
Here is my code :
function handlerEvent()
{
displayAlert('Handler clicked');
}
Microsoft.Maps.loadModule('Microsoft.Maps.Themes.BingTheme', { callback: function()
{
map = new Microsoft.Maps.Map(document.getElementById('bingMap'),
{
credentials: 'xxxxxxxxxxxxxxxxxxxxxxx',
theme: new Microsoft.Maps.Themes.BingTheme(),
center: new Microsoft.Maps.Location(47.219058,-1.553625),
mapTypeId: Microsoft.Maps.MapTypeId.birdseye,
zoom: 16,
showDashboard: false
});
var infoboxOptions = {title:'Text', description:'TextTextText', actions:[{label: 'Click Handler', eventHandler: handlerEvent}]};
map.entities.push(new Microsoft.Maps.Infobox(map.getCenter(), infoboxOptions));
}});
Can you help me do that?
Add this option
labelOverlay : Microsoft.Maps.LabelOverlay.hidden

Sencha Touch 1.1.0: Form is not showing scrollbars

I am creating an Application that consist of a Panel,
This panel contains a Tab-Panel and a Form-Panel. (Initially, Form-Panel is Hidden)
The Tab-Panel has a Tab, which contains a List.
When Tapped on a List-Item it dose the following
Shows the Form-Panel
Hides the Tab-Panel
My Problem is When it does so , The form do not show any scroll bars, How ever when i change the orientation of the device(iPhone) and then it allows me to scroll.
Can anyone explain me if i am doing it correctly, or is there any better way to achieve this functionality, or can the Main Panle be changed with a view Port ?
A small example will be really great.
Below is my Code (i will try to keep it simple)
Decleration of List and Event Listener
var lstRequestTracker = new Ext.List({
itemTpl : '{emplFirstName} {emplLastName}'
,store : storeRequestTracker
,fullscreen: true
});
lstRequestTracker.on('itemtap', function( oThis, index, item, event) {
var rec = oThis.getStore().getAt(index);
tpnlMyForms.hide();
fpnlOnBoard.show();
//pnlMain.doComponentLayout();
fpnlOnBoard.doComponentLayout();
});
Code for declaring the Main-Panel, Tab-Panel and The Form-Panel
var tpnlMyForms = new Ext.TabPanel({
tabBar : {dock : 'bottom', layout:'hbox'}
,fullscreen : true
,defaults : {scroll: 'vertical', layout:'fit'}
,items : [ {
title : 'Request Tracker'
,items : [lstRequestTracker]
,iconCls: 'time'
}
]
});
var fpnlOnBoard = new Ext.form.FormPanel({Contains form Fields});
Ext.setup({
onReady: function() {
var pnlMain = new Ext.Panel({
fullscreen : true
,dockedItems: [{dock:'top', xtype:'toolbar',title:'STARS'}]
,layout: 'fit'
,items : [tpnlMyForms,fpnlOnBoard]
});
fpnlOnBoard.hide();
}// eo onReady Function
});
Have you tried giving your formPanel a scroll option (scoll: 'horizontal') ? I really don't know wether this will help, but I remember I also had a form a few days ago and this was the solution. That had nothing to do with the device orientation by the way, but who knows..

iPad-like pop-over in Sencha touch

I want to create an iPad-like pop-over with a login form in Sencha touch. How can I do this?
You may try making a normal Ext.Panel to look like a popover
var gkpopover = new Ext.Panel({
id :'gkpopoverpanel',
floating:true,
modal:true,
width:'100px',
height:'100px', });
Note: Never forget to set height and width.
and to Show
gkpopover.show('pop');
hope this makes sense.
On sencha touch 2, floating is depreciated. I've modified #geekay code to;
//show info popover?
var popoverpanel = new Ext.Panel({
modal:true,
left:'10%',
top:'10%',
width:'80%',
height:'80%',
hideOnMaskTap: true,
html:data.info
});
Ext.Viewport.add(popoverpanel);
popoverpanel.show('pop');
Credits go to him!
As this post points out, sencha have very exactly what you need.
Try this :
new Ext.Panel({
fullscreen : true,
items : [
{
xtype : 'toolbar',
docked : 'top',
items : [
{
text : 'Open',
handler : function (button) {
var panel = new Ext.Panel({
height : 200,
width : 200,
html : 'Hello'
});
panel.showBy(button, 'tr-bc?');
}
}
]
}
]});