Change table contents on hover?
I have a table like this:
<div class="footer_row_3">
<table class="tableA">
<tr>
<td><img class="popcorn" src="http://i.imgur.com/HUjq2Va.png"></td>
<td><span class="statement">Lorem Ipsum</span></td>
<td><img class="popcorn" src="http://i.imgur.com/HUjq2Va.png"></td>
</tr>
</table>
</div>
What I want to do is that when the mouse hovers over tableA at any
location within tableA, the following two changes happen:
1) Popcorn images change to this image: http://i.imgur.com/K29T3Fw.png 2)
The text color changes to red.
Also, it should have with a CSS 'fade' style transition, so that the
contents fades into the updated style contents.
Also, BOTH changes mentioned above should happen when I hover tableA from
any place within tableA.
I know how to individually change text and image on hover, but I don't
know how to do it together for multiple items.
How can I achieve this effect ?
Saturday, 14 September 2013
Windows phone:access subproperty of binding
Windows phone:access subproperty of binding
I have a custom pivot control where all the UI is generated using
template.It looks like this:
<controls:Pivot ItemsSource="{Binding superSets}">
<controls:Pivot.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}"></TextBlock>
</DataTemplate>
</controls:Pivot.HeaderTemplate>
<controls:Pivot.ItemTemplate>
<DataTemplate>
<ListBox ItemsSource="{Binding Source={StaticResource
SortedNews}}">
<ListBox.ItemTemplate>
<!- datatemplate Code -->
</ListBox.ItemTemplate>
</ListBox>
</DataTemplate>
</controls:Pivot.ItemTemplate>
</controls:Pivot>
Now,I want to sort the contents of listbox so I designed a
collectionviewsource like this:
<CollectionViewSource x:Key="SortedNews" Source="{Binding Path=Articles}">
<CollectionViewSource.SortDescriptions>
<scm:SortDescription
PropertyName="Pubdate"></scm:SortDescription>
</CollectionViewSource.SortDescriptions>
</CollectionViewSource>
About the superSets: It contains an Observable collection type property
Articles
Now when I run the program I get an error saying Property 'Articles' not
found
Any Ideas?
I have a custom pivot control where all the UI is generated using
template.It looks like this:
<controls:Pivot ItemsSource="{Binding superSets}">
<controls:Pivot.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}"></TextBlock>
</DataTemplate>
</controls:Pivot.HeaderTemplate>
<controls:Pivot.ItemTemplate>
<DataTemplate>
<ListBox ItemsSource="{Binding Source={StaticResource
SortedNews}}">
<ListBox.ItemTemplate>
<!- datatemplate Code -->
</ListBox.ItemTemplate>
</ListBox>
</DataTemplate>
</controls:Pivot.ItemTemplate>
</controls:Pivot>
Now,I want to sort the contents of listbox so I designed a
collectionviewsource like this:
<CollectionViewSource x:Key="SortedNews" Source="{Binding Path=Articles}">
<CollectionViewSource.SortDescriptions>
<scm:SortDescription
PropertyName="Pubdate"></scm:SortDescription>
</CollectionViewSource.SortDescriptions>
</CollectionViewSource>
About the superSets: It contains an Observable collection type property
Articles
Now when I run the program I get an error saying Property 'Articles' not
found
Any Ideas?
Real-Time Updates: Certificate verify failed
Real-Time Updates: Certificate verify failed
I am currently trying to set up Real-Time Updates to my site through the
facebook app interface. When I attempt to test the callback to the
callback url of https://messageall.com/facebook/callback/ I am getting an
error message of:
Callback verification failed:
SSL certificate problem, verify that the CA cert is OK.
Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify
failed
However from what I can tell the certificate key chain is working fine and
verifies when I test via http://www.digicert.com/help/
What could the facebook servers think is wrong with my CA?
I am currently trying to set up Real-Time Updates to my site through the
facebook app interface. When I attempt to test the callback to the
callback url of https://messageall.com/facebook/callback/ I am getting an
error message of:
Callback verification failed:
SSL certificate problem, verify that the CA cert is OK.
Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify
failed
However from what I can tell the certificate key chain is working fine and
verifies when I test via http://www.digicert.com/help/
What could the facebook servers think is wrong with my CA?
Can't declare Class field type of the other class
Can't declare Class field type of the other class
Why i can't declare Class field type of the other class? This gives me
C4430 error:
//Entity.h file
class Entity
{
public:
Box test;
};
class Box
{
public:
double length; // Length of a box
double breadth; // Breadth of a box
double height; // Height of a box
};
Why i can't declare Class field type of the other class? This gives me
C4430 error:
//Entity.h file
class Entity
{
public:
Box test;
};
class Box
{
public:
double length; // Length of a box
double breadth; // Breadth of a box
double height; // Height of a box
};
Friday, 13 September 2013
Android Fragment: View fully from code causes binding to null-object
Android Fragment: View fully from code causes binding to null-object
I have quite a few fragments, that are 90% common in layout. And because I
really like layout from code (I never create XIBs for iOS anymore), I
thought: lets do the same for Android. That was not as easy as I thought
it would be. The trouble is in MvvmCross, and after scouring the web for
solutions, only hints pointing to the solution can be found.
The problem: when the fragment is displayed, and I perform the binding, I
get all messages the source property cannot be found because it tries to
bind to a null-object.
Unable to bind: source property source not found
Cirrious.MvvmCross.Binding.Parse.PropertyPath.PropertyTokens.MvxPropertyNamePropertyToken
on null-object
The layout is displayed on screen, the ViewModel is set, the
bindingcontext is set (both created by myself, because that was not done
automatically).
I suspect something is done in inflation to 'register' the created
controls, and because I do not use inflation, they are not registered. I
read in other questions about the MvxBindingContextStackRegistration,
watched the sources for that. Second cause might be the bindingcontext
itself: somehow it is not handled automatically, and that points to
something necessary missing beging called in the below code.
I might have done some strange thing, because this is the final attempt to
get it working:
public class IndexTocFragment : MvxFragment
{
// two statics to save on typing
public static int WRAP = ViewGroup.LayoutParams.WrapContent;
public static int FILL = ViewGroup.LayoutParams.FillParent;
public LinearLayout NewVerticalLinearLayout(Orientation orientation,
Boolean fillparent) {
var ll = new LinearLayout (Activity) { Orientation = orientation };
ll.LayoutParameters = new ViewGroup.LayoutParams (FILL, fillparent
? FILL : WRAP);
return ll;
}
public new IndexTocViewModel ViewModel { get { return base.ViewModel
as IndexTocViewModel; } set { base.ViewModel = value; } }
public override View OnCreateView(LayoutInflater inflater, ViewGroup
container, Bundle savedInstanceState)
{
base.OnCreateView (inflater, container, savedInstanceState);
var layout = NewVerticalLinearLayout (Orientation.Vertical, true);
if (ViewModel == null)
ViewModel = Mvx.IocConstruct<IndexTocViewModel> ();
BindingContext = new MvxAndroidBindingContext (Activity, new
MvxSimpleLayoutInflater(inflater));
using (new
MvxBindingContextStackRegistration<IMvxAndroidBindingContext>(((IMvxAndroidBindingContext)
this.BindingContext)))
{
//var layout = NewVerticalLinearLayout (Orientation.Vertical,
true);
layout.SetBackgroundColor (Color.ParseColor("#FFFFFF"));
var titlelayer = NewVerticalLinearLayout
(Orientation.Horizontal, false);
titlelayer.LayoutParameters.Height = 40;
var title = new TextView (Activity) { LayoutParameters = new
ViewGroup.LayoutParams (FILL, FILL) };
title.SetTextColor (Color.ParseColor ("#212121"));
var titlebutton = new Button (Activity) { LayoutParameters =
new ViewGroup.LayoutParams (WRAP, FILL) };
titlelayer.AddView (title);
titlelayer.AddView (titlebutton);
layout.AddView (titlelayer);
var twobuttonlayer = NewVerticalLinearLayout
(Orientation.Horizontal, false);
twobuttonlayer.LayoutParameters.Height = 40;
var twobuttonklein = new Button (Activity) { LayoutParameters
= new ViewGroup.LayoutParams (FILL, WRAP) };
twobuttonklein.Text = "Klein";
twobuttonklein.SetBackgroundResource
(Resource.Drawable.kleingrootbutton);
var twobuttongroot = new Button(Activity){ LayoutParameters =
new ViewGroup.LayoutParams (FILL, WRAP) };
twobuttongroot.Text = "Middel/groot";
twobuttongroot.SetBackgroundResource
(Resource.Drawable.kleingrootbutton);
twobuttonlayer.AddView (twobuttonklein);
twobuttonlayer.AddView (twobuttongroot);
layout.AddView (twobuttonlayer);
var zoekvak = new EditText (Activity) { LayoutParameters = new
ViewGroup.LayoutParams (FILL, WRAP) };
zoekvak.Hint = "Zoek in inhoudsopgave";
layout.AddView (zoekvak);
var emptytext = new TextView (Activity) { LayoutParameters =
new ViewGroup.LayoutParams (FILL, WRAP),
Text = "Er zijn geen resultaten." };
emptytext.SetBackgroundColor (Color.ParseColor ("#BBAA00"));
layout.AddView (emptytext);
var listadapter = new
BindableExpandableListAdapter(this.Activity,
(IMvxBindingContext) BindingContext);
var list = new BindableExpandableListView (Activity, null,
listadapter) { LayoutParameters = new ViewGroup.LayoutParams
(FILL, FILL) };
list.SetMinimumHeight (50);
list.ItemTemplateId = Resource.Layout.indextocsectionlistitem;
list.GroupTemplateId = Resource.Layout.indextocitem;
list.SetGroupIndicator (null);
list.SetBackgroundColor (Color.ParseColor ("#AAAA00"));
layout.AddView (list);
this.DoBind += () => {
var bs = this.CreateBindingSet<IndexTocFragment,
IndexTocViewModel> ();
if (ViewModel == null) {
Console.WriteLine ("ERROR ViewModel not set");
}
if (BindingContext == null) {
Console.WriteLine ("ERROR BindingContext not set");
}
bs.Bind (title).For (x => x.Text).To (vm => vm.IndexTitle);
// the following title displays some data from the
ViewMode, and that works OK.
Console.WriteLine("Index title value:
"+ViewModel.IndexTitle);
bs.Bind (twobuttongroot).For ("Click").To (vm =>
vm.SwitchKleinGrootCommand);
bs.Bind (twobuttonklein).For ("Click").To (vm =>
vm.SwitchKleinGrootCommand);
bs.Bind (zoekvak).For (x => x.Text).To (vm => vm.SearchText);
bs.Bind (emptytext).For (x => x.Text).To (vm =>
vm.TextForEmptyList);
bs.Bind (listadapter).For(x => x.ItemsSource).To(vm =>
vm.Chapters);
bs.Apply ();
};
// the next binding was never called
//this.DelayBind (() => {
//
//});
}
//var view = this.BindingInflate(Resource.Layout.IndexTocView, null);
Console.WriteLine ("LAYOUT RETURNED");
return layout;
}
private Action DoBind;
public override void OnResume()
{
// doing the binding here to make sure everything should have been
set,
but it is of course not the logical location
base.OnResume();
Console.WriteLine ("RESUMING");
if (DoBind != null)
DoBind ();
}
}
For now I will create a fragment layout with everyting I need, and hide
the elements that are not needed, that will probably work. But I hope I
can use creating views from code.
Thanks for helping.
I have quite a few fragments, that are 90% common in layout. And because I
really like layout from code (I never create XIBs for iOS anymore), I
thought: lets do the same for Android. That was not as easy as I thought
it would be. The trouble is in MvvmCross, and after scouring the web for
solutions, only hints pointing to the solution can be found.
The problem: when the fragment is displayed, and I perform the binding, I
get all messages the source property cannot be found because it tries to
bind to a null-object.
Unable to bind: source property source not found
Cirrious.MvvmCross.Binding.Parse.PropertyPath.PropertyTokens.MvxPropertyNamePropertyToken
on null-object
The layout is displayed on screen, the ViewModel is set, the
bindingcontext is set (both created by myself, because that was not done
automatically).
I suspect something is done in inflation to 'register' the created
controls, and because I do not use inflation, they are not registered. I
read in other questions about the MvxBindingContextStackRegistration,
watched the sources for that. Second cause might be the bindingcontext
itself: somehow it is not handled automatically, and that points to
something necessary missing beging called in the below code.
I might have done some strange thing, because this is the final attempt to
get it working:
public class IndexTocFragment : MvxFragment
{
// two statics to save on typing
public static int WRAP = ViewGroup.LayoutParams.WrapContent;
public static int FILL = ViewGroup.LayoutParams.FillParent;
public LinearLayout NewVerticalLinearLayout(Orientation orientation,
Boolean fillparent) {
var ll = new LinearLayout (Activity) { Orientation = orientation };
ll.LayoutParameters = new ViewGroup.LayoutParams (FILL, fillparent
? FILL : WRAP);
return ll;
}
public new IndexTocViewModel ViewModel { get { return base.ViewModel
as IndexTocViewModel; } set { base.ViewModel = value; } }
public override View OnCreateView(LayoutInflater inflater, ViewGroup
container, Bundle savedInstanceState)
{
base.OnCreateView (inflater, container, savedInstanceState);
var layout = NewVerticalLinearLayout (Orientation.Vertical, true);
if (ViewModel == null)
ViewModel = Mvx.IocConstruct<IndexTocViewModel> ();
BindingContext = new MvxAndroidBindingContext (Activity, new
MvxSimpleLayoutInflater(inflater));
using (new
MvxBindingContextStackRegistration<IMvxAndroidBindingContext>(((IMvxAndroidBindingContext)
this.BindingContext)))
{
//var layout = NewVerticalLinearLayout (Orientation.Vertical,
true);
layout.SetBackgroundColor (Color.ParseColor("#FFFFFF"));
var titlelayer = NewVerticalLinearLayout
(Orientation.Horizontal, false);
titlelayer.LayoutParameters.Height = 40;
var title = new TextView (Activity) { LayoutParameters = new
ViewGroup.LayoutParams (FILL, FILL) };
title.SetTextColor (Color.ParseColor ("#212121"));
var titlebutton = new Button (Activity) { LayoutParameters =
new ViewGroup.LayoutParams (WRAP, FILL) };
titlelayer.AddView (title);
titlelayer.AddView (titlebutton);
layout.AddView (titlelayer);
var twobuttonlayer = NewVerticalLinearLayout
(Orientation.Horizontal, false);
twobuttonlayer.LayoutParameters.Height = 40;
var twobuttonklein = new Button (Activity) { LayoutParameters
= new ViewGroup.LayoutParams (FILL, WRAP) };
twobuttonklein.Text = "Klein";
twobuttonklein.SetBackgroundResource
(Resource.Drawable.kleingrootbutton);
var twobuttongroot = new Button(Activity){ LayoutParameters =
new ViewGroup.LayoutParams (FILL, WRAP) };
twobuttongroot.Text = "Middel/groot";
twobuttongroot.SetBackgroundResource
(Resource.Drawable.kleingrootbutton);
twobuttonlayer.AddView (twobuttonklein);
twobuttonlayer.AddView (twobuttongroot);
layout.AddView (twobuttonlayer);
var zoekvak = new EditText (Activity) { LayoutParameters = new
ViewGroup.LayoutParams (FILL, WRAP) };
zoekvak.Hint = "Zoek in inhoudsopgave";
layout.AddView (zoekvak);
var emptytext = new TextView (Activity) { LayoutParameters =
new ViewGroup.LayoutParams (FILL, WRAP),
Text = "Er zijn geen resultaten." };
emptytext.SetBackgroundColor (Color.ParseColor ("#BBAA00"));
layout.AddView (emptytext);
var listadapter = new
BindableExpandableListAdapter(this.Activity,
(IMvxBindingContext) BindingContext);
var list = new BindableExpandableListView (Activity, null,
listadapter) { LayoutParameters = new ViewGroup.LayoutParams
(FILL, FILL) };
list.SetMinimumHeight (50);
list.ItemTemplateId = Resource.Layout.indextocsectionlistitem;
list.GroupTemplateId = Resource.Layout.indextocitem;
list.SetGroupIndicator (null);
list.SetBackgroundColor (Color.ParseColor ("#AAAA00"));
layout.AddView (list);
this.DoBind += () => {
var bs = this.CreateBindingSet<IndexTocFragment,
IndexTocViewModel> ();
if (ViewModel == null) {
Console.WriteLine ("ERROR ViewModel not set");
}
if (BindingContext == null) {
Console.WriteLine ("ERROR BindingContext not set");
}
bs.Bind (title).For (x => x.Text).To (vm => vm.IndexTitle);
// the following title displays some data from the
ViewMode, and that works OK.
Console.WriteLine("Index title value:
"+ViewModel.IndexTitle);
bs.Bind (twobuttongroot).For ("Click").To (vm =>
vm.SwitchKleinGrootCommand);
bs.Bind (twobuttonklein).For ("Click").To (vm =>
vm.SwitchKleinGrootCommand);
bs.Bind (zoekvak).For (x => x.Text).To (vm => vm.SearchText);
bs.Bind (emptytext).For (x => x.Text).To (vm =>
vm.TextForEmptyList);
bs.Bind (listadapter).For(x => x.ItemsSource).To(vm =>
vm.Chapters);
bs.Apply ();
};
// the next binding was never called
//this.DelayBind (() => {
//
//});
}
//var view = this.BindingInflate(Resource.Layout.IndexTocView, null);
Console.WriteLine ("LAYOUT RETURNED");
return layout;
}
private Action DoBind;
public override void OnResume()
{
// doing the binding here to make sure everything should have been
set,
but it is of course not the logical location
base.OnResume();
Console.WriteLine ("RESUMING");
if (DoBind != null)
DoBind ();
}
}
For now I will create a fragment layout with everyting I need, and hide
the elements that are not needed, that will probably work. But I hope I
can use creating views from code.
Thanks for helping.
Android Studio for Windows is not installing and updating packages
Android Studio for Windows is not installing and updating packages
When I run the Android SDK Manager and I try to install or update it fails
and I can't install anything.
How can I do to install or update new packages?
Thank you
When I run the Android SDK Manager and I try to install or update it fails
and I can't install anything.
How can I do to install or update new packages?
Thank you
Django's mark_for_escaping doesn't work with custom template tags?
Django's mark_for_escaping doesn't work with custom template tags?
I have a Django template tag that looks like this:
from django import template
from django.utils.safestring import mark_for_escaping
register = template.Library()
@register.simple_tag(takes_context=True)
def hello_world(context):
return mark_for_escaping("Hello, <world>!")
But when it's used in templates the output isn't being escaped.
What's going on? Is the output of template tags always assumed to be safe?
I have a Django template tag that looks like this:
from django import template
from django.utils.safestring import mark_for_escaping
register = template.Library()
@register.simple_tag(takes_context=True)
def hello_world(context):
return mark_for_escaping("Hello, <world>!")
But when it's used in templates the output isn't being escaped.
What's going on? Is the output of template tags always assumed to be safe?
Subscribe to:
Posts (Atom)