Suggestions for a Flipview with Pages inside (Windows 8.1 app) - windows-store-apps

I'm trying to create an app which shows a different page on swiping left or right.
I'm using the flipview control and loading it with Page class objects.
It works well, but when I select a textbox inside, the control recieving the focus is the flipview instead of the textbox, and then the keyboard covers it.
My question is, how I should implement his UI?
The actual structure is something like (this is not real code, but the simpliest way to show the structure)
<Page>
<FlipView> <---- This gets the focus instead of the textbox
<SetupPage>
<TextBox1 /> <--- This textbox is clicked and shows the keyboard
</SetupPage>
<AnalyzePage>
<TextBox2 />
</AnalyzePage>
</Flipview>
</Page>
I've tried using FlipViewItem around the pages, and also trying to override the focus logic of the flipview. I haven't suceeded in any case.
Thanks!

Related

Windows phone 8.1 Universal app - Show the Button all the time

In Windows phone 8.1 universal app, Appbar currently support only icons, not the buttons. If i use the button, Button is hidden below the keyboard.
I need help to achieve either one of the below
I want to show the Button below the Keyboard, Any ways to achieve it?
Or, Move the Button above the Keyboard when keyboard appears. When Keyboard is not shown, Button should be at the Bottom of the page. Is there any way to do this?
It helps User to see the Button clearly all the time.
React on an OnInputPaneShowing event. The size of the input control is passed into this function and you can update the position of the button according this size.
See MSDN respond to the keyboard presence and MSDN occluded rect property for more info on how to do this.

WinRT FlipView Scrolling Event

Is it possible to know, when a FlipView is sliding back or forth, what item is currently on screen? The only relevant event I can see is SelectionChanged, which only gets raised when the FlipView comes to a rest and not if the person is quickly flipping through multiple items. I want to implement a "page number" indicator that changes even when the FlipView has not come to a rest. I'm using C++/CX.
You could check the ScrollViewer that is part of the control template of the FlipView. To get hold of the control - you would use the VisualTreeHelper to scan the visual tree looking for it. Then perhaps the ScrollViewer's ViewChanged event would let you see if the FlipView was manipulated.
If all you want to do is show a page number, you could DataBind the TextView displaying the number to the FlipView's SelectedIndex property. You'll need to create a ValueConverter that adds 1 to the SelectedIndex, but that'll only take a minute.

flyout should not hide when the user taps/clicks in metro app

In my metro style app (windows 8) I have created an page overlay and a flyout displaying an message. When the user clicks on the page the flyout message goes to hidden. But I want flyout to remain even when the user clicks on the overlay page. I am using HTML5 and WinJS.
Is there anyway I can achieve the above scenario using someother control or can I prevent the page to stop reacting to events when the user taps/clicks on the screen.
This is not really supported -- the Flyout itself doesn't have the concept of being persistent/sticky/modal. If you look at the code in base.js, you'll see that it doesn't expose any code to leverage the inbuilt sticky behavior that is used in the appbar (which is kinda of flyout, it turns out.
There are a couple things you can do:
Pass "_sticky: true" to the constructor of the flyout. e.g <div data-win-control="WinJS.UI.Flyout" data-win-options="{ _sticky: true}">
Attach a click handler to the top of the document, and if it's on the click eating div that the flyout creates, cancel the event
Create your own UI by simply adding a new div to the body, and absolute positioning it.

setFocus in Flex

I'm Using following code in flex4 mxml That works fine.
<mx:Button label="Set focus to Username"
click="focusManager.setFocus(username);" />
How to use the same in Action script I mean creation complete event of an application without using button.
That is I have login panel in application While page loads the
username field should focused having cursor in it.
Can any one help me?
The issue is that within your application the TextInput has focus, but within the HTML page your Flex application does not. So basically the only extra step you need is to give the Flex app focus. There's only one way to achieve this: through JavaScript. And you should do it after the application was loaded.
The guys at Farrata wrote a very good example on how to do this, so I'm just going to point you there: http://flexblog.faratasystems.com/2011/12/15/setting-focus-in-flex-components

Primefaces - using dialogs and layouts

I have a (JSF 2.0/ Primefaces 2.2RC-SNAPSHOT) app that has
<p:layout>
I use a lot of dialog in my application and before the newest version of primefaces came out there was no way to display a dialog with a modal on top of the layout without putting the dialogs outside of the tags.
So I did just that. The issue I am having now is I am noticing that constructors and postcontructs are being called when my application is loaded. This is because the view with the layout is being loaded and therefore all my dialogs are being loaded.
I don't want these constructors being called until I am actually dealing with the appropriate views in my application.
I have been testing the appendToBody attribute on the
<p:dialog>
tag but it seems really buggy. Everything works fine on the initial rendering of a view. I can open a dialog close it etc and it works fine. If I navigate away to another view and then come back to the initial view and open the dialog, everything is running off the page. The dialog window is in the correct place but the content is not.
My question is 1. Is there a way I can have the dialog windows outside of my layout as a child of the
<h:body>
without having all the managed bean constructors associated with them initiated when the application loads?
Or does anyone know how to fix the alignment issue when using the appendToBody tag? Thanks.
When using layout and dialog, I usually place my dialogs outside of the layout as a direct child of the body element. I have a special ui:insert part in my page template for this.
appendToBody was added to make this easier, if it doesn't work well for you, give this approach a try. I know modal dialogs and layout can work this way.
without having all the managed bean constructors associated with them
initiated when the application loads
Maybe the managedbean gets loaded when your dialog is rendered.
Try rendering the dialog only after the button click, perhaps byputting rendered="#{mybean.flagLoadMyDialog}" on the dialog, and set the flagLoadMyDialog when the button is clicked using ajax.
Also remember to ajax-update the dialog after the button click.