How I can find MouseClick or GotFocus event in PivotItem.? - windows-phone-7.1

Hello How I can find GotFocus event into the PivotItem I had tired with GalaSoft Interaction with Triger and EventName="GotFocus" but it is not fired can anybody help me to find the PivioItem Event.
Thank you.

the pivot item gets focus upon cliking any control placed inside that pivot item.
<controls:PivotItem Header="item1">
<i:Interaction.Triggers>
<i:EventTrigger EventName="GotFocus">
<i:InvokeCommandAction Command="{Binding ShowMessageCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<Grid>
<TextBox Height="100"
Width="200"/>
<Button Height="100"
Width="200" />
</Grid>
</controls:PivotItem>
This code works for me. the pivot item get focus upon clicking the button or the text box.
Hope this helps you.

Yes,
here you are the solution:
<controls:Pivot Title="My Pivot">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding EuropePivotSelectedCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<controls:PivotItem Header="item1">
</controls:PivotItem>
<controls:PivotItem Header="item2">
</controls:PivotItem>
Regards
Juanlu, ElGuerre

Related

NativeScript page-router-outlet always taking up 100% height on iOS when used with RadSideDrawer

When using the RadSideDrawer with a page-router-outlet in NativeScript, it seems that there is no way to not have the page-router-outlet fill 100% of the height on iOS. On Android, it works fine. The reason I'm running into this issue is because I'm trying to add a BottomNavigationBar below my router outlet. The images below show the behavior on both iOS and Android:
Here is my code:
<RadSideDrawer>
<FlexboxLayout tkDrawerContent>
<Button text="Test"></Button>
</FlexboxLayout>
<GridLayout class="main-grid" tkMainContent rows="*, auto">
<StackLayout row="0">
<page-router-outlet></page-router-outlet>
</StackLayout>
<BottomNavigationBar activeColor="white" inactiveColor="gray" backgroundColor="black" row="1">
<BottomNavigationTab title="First"></BottomNavigationTab>
<BottomNavigationTab title="Second"></BottomNavigationTab>
<BottomNavigationTab title="Third"></BottomNavigationTab>
</BottomNavigationBar>
</GridLayout>
</RadSideDrawer>
If I remove the page-router-outlet and put anything in it's place, it will then function correctly on both iOS and Android. Also, if I leave the page-router-outlet and remove the RadSideDrawer, it also functions correctly.
Any suggestions? Thanks!
EDIT:
It seems as if this issue only occurs when there are two page-router-outlets nested as in this sample playground:
https://play.nativescript.org/?template=play-ng&id=Z2a5Z7
Maybe page-router-outlets aren't supposed to be nested then? Right now I have a page-router-outlet in my app.component that lazy loads and switches between a login.component and my main app pages.component. pages.component contains the RadSideDrawer and the other page-router-outlet. I did this so I can lazy load my authorization pages and regular app content pages. Is this wrong?
It seems to be a issue with RadSideDrawer plugin (v8.0.0), the plugin is not open sourced so the best approach would be raising an issue in nativescript-ui-feedback and I see you have done that already - #1362.
I have a workaround that seem to fix the issue on my end.
MainComponent
constructor(page: Page) {
page.once(Page.navigatedToEvent, () => {
page.frame.requestLayout();
});
}
Request for relayout once the page is loaded.
Updated Playground
In my case, I have a modal page full height width over the side drawer, so I created a structure like below. Hope this helps you.
<GridLayout rows="" columns="" [class.dialogOpen]="dialogOpen">
<StackLayout>
<RadSideDrawer tkExampleTitle tkToggleNavButton drawerContentSize="320">
<StackLayout tkDrawerContent>
<app-sidenav></app-sidenav>
// my side drawer data
</StackLayout>
<GridLayout tkMainContent class="app" rows="auto,*,auto">
<GridLayout row="0" columns="*" rows="auto,auto" *ngIf="data.navbar" class="gradient">
// custom header
</GridLayout>
<!-- main content -->
<FlexboxLayout row="1">
<StackLayout #container>
<StackLayout [ngClass]="{'full': data.full }">
<ng-content></ng-content>
</StackLayout>
</StackLayout>
</FlexboxLayout>
<!-- Footer -->
<FlexboxLayout row="2" *ngIf="data.footer" class="app__footer" verticalAlignment="bottom">
// bottom tabs for my app
</FlexboxLayout>
</GridLayout>
</RadSideDrawer>
</StackLayout>
<StackLayout verticalAlignment="center" horizontalAlignment="center" height="100%" class="dialog__wrapper">
<AbsoluteLayout height="100%" backgroundColor="#FFFFFF" verticalAlignment="center" horizontalAlignment="center">
<!-- EDIT POPUP -->
<StackLayout class="dialog__container">
// cusotm dialog data
</StackLayout>
</AbsoluteLayout>
</StackLayout>
</GridLayout>

Nativescript-Vue IOS Safe Area Layout Issue

I have an issue with the ios Safe Area with Nativescript-Vue on iPhone X and above. I think it has something to do with the nested frames/pages setup we have. We use a custom header and then for the 'body' of the app when we want to navigate we navigate pages within the nested frame. The custom header will enter the safe area without an issue, but the bottom safe area remains.
The nested Page component itself appears to enter the safe area, but any layout inside that page appears constrained to be outside the safe area.
Here is a playground that shows what's happening: https://play.nativescript.org/?template=play-vue&id=pXmqzC&v=3
In the playground you can see this by the borders I've drawn around the Page and the StackLayout.
Here's the layout code in case you can't access the playground sample:
<template>
<Page actionBarHidden="true">
<GridLayout rows="90, *">
<StackLayout row="1" height="100%">
<Frame>
<Page actionBarHidden="true" height="100%" borderWidth="5" borderColor="red" >
<StackLayout height="100%" width="100%" horizontalAlignment="center" verticalAlignment="center" backgroundColor="green" borderWidth="5">
<Label text="Body" horizontalAlignment="center" verticalAlignment="center" />
</StackLayout>
</Page>
</Frame>
</StackLayout>
<!-- Simulates a header -->
<StackLayout row="0" height="90" width="100%" horizontalAlignment="center" verticalAlignment="center" backgroundColor="blue">
<Label text="Header" horizontalAlignment="center" verticalAlignment="center" />
</StackLayout>
</GridLayout>
</Page>
</template>
An easy fix is to remove StackLayout above Frame.
<template>
<Page actionBarHidden="true">
<GridLayout rows="90, *">
<!-- <StackLayout row="1" height="100%"> -->
<Frame row="1" borderWidth="0">
<Page actionBarHidden="true" height="100%" borderWidth="5" bordercolor="red">
<StackLayout
height="100%"
width="100%"
horizontalAlignment="center"
verticalAlignment="center"
backgroundColor="green"
borderWidth="5"
>
<Label text="Body" horizontalAlignment="center" verticalAlignment="center" />
</StackLayout>
</Page>
</Frame>
<!-- </StackLayout> -->
<!-- Simulates a header -->
<StackLayout
row="0"
height="90"
width="100%"
horizontalAlignment="center"
verticalAlignment="center"
backgroundColor="blue"
>
<Label text="Header" horizontalAlignment="center" verticalAlignment="center" />
</StackLayout>
</GridLayout>
</Page>
</template>
Things to remember,
You don't really need a StackLayout above Frame, it doesn't server any purpose right there.
Avoid setting height="100%" by default content of Page / Frame takes it's whole height, you don't have to specify in percentage, at least when it's 100
When you set verticalAlignment to center, you force the layout to fit to center on it's parent, but again why to set height to 100%, that doesn't make sense.

Using Titanium, alloy, I'm trying to make a basic: name password and email field. How would I go about this?

I am making an app in Titanium. The XML is different from that of Net Beans. for example:
<Alloy>
<Window>
<TextField hintText="Login"></TextField>
<TextField hintText="Password" passwordMask="true"></TextField>
<Button>Login</Button>
</Window>
</Alloy>
this will put the 2 TextField and button all on top of each other... Y?
First take a look at the docs. on how to style your views. These guides help a lot.
Then try a vertical layout for your window, and more defined sizes for your inputs:
<Alloy>
<Window layout="vertical">
<TextField hintText="Login" height="40" width="Ti.UI.FILL"></TextField>
<TextField hintText="Password" passwordMask="true" height="40" width="Ti.UI.FILL"></TextField>
<Button height="40" width="Ti.UI.FILL">Login</Button>
</Window>
</Alloy>
That should get you started.

tooltip not working

I'm using this code in *.xul
<tooltip id="tt">
<label value="additional information"/>
</tooltip>
<statusbar id="status-bar">
<statusbarpanel id="mypanel" tooltip="tt"
label="my panel"
/>
</statusbar>
I don't know why but when I'm over mypanel with mouse. There is no popup window with "additional information"
thank you for help
I'm not sure, but this might be because the <tooltip> element needs to be inside of a <popupset> element. By the way, you shouldn't use the statusbar anymore; use the add-on bar instead: https://developer.mozilla.org/en/The_add-on_bar

XUL Textbox inside Popup not working

I am working on creating a Firefox extension. I have added a textbox inside a popup. The popup opens on clicking on a toolbar button. The textbox is appearing but does not let me edit it. I have not given any read only attributes.
Here is the code:
<popupset id="myPopupSet">
<popup id="trial-popup" noautohide="true" position="after_start">
<vbox>
<label value="Enter your name:"/>
<textbox id="identfier_box" value="This is some text."/>
</vbox>
</popup>
</popupset>
<toolbarpalette id="BrowserToolbarPalette">
<toolbarbutton id="mybutton"
class="toolbarbutton-1"
label="Identifier"
popup="trial-popup"
insertbefore="urlbar-container" />
can anyone let me know why there is this problem?
Thanks!
What you really want is a panel and not a popup.
Change <popup> to <panel> and you have what you want.

Resources