Avalonia Template binding SelectedChanged - templates

I have a template with this markup
`
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:AMIS_S01.Views.Templates">
<Design.PreviewWith>
<controls:ReportsTemplate />
</Design.PreviewWith>
<Style Selector="controls|ReportsTemplate">
<!-- Set Defaults -->
<Setter Property="Template">
<ControlTemplate>
<Panel>
<DatePicker DayVisible="False" MonthFormat="MM" SelectedDateChanged="SelectedDateXmls"
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="180 8 0 0"/>
</Panel>
</ControlTemplate>
</Setter>
</Style>
</Styles>
`
The SelectedDateChanged has such a mistake: enter image description here
How do I create a template and bind this field to it, and what should I do if there are many such properties?
I expected the property "SelectedDateChanged" to take the name "SelectedDateXmls" without any problems and join correctly at runtime

Related

How to prefill edit boxes when my custom dialog is shown from the custom action script in my MSI?

I'm using WiX to create a custom dialog/page in my installer, based on WixUI_Mondo. The custom dialog has edit controls, similar to this:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
<Dialog Id="ConfigDlg" Width="370" Height="270" Title="!(loc.SetupTypeDlg_Title)" >
<Control Id="idTxt11" Type="Text" X="20" Y="65" Width="60" Height="16" Text="Name:" />
<Control Id="idEdt11" Type="Edit" X="90" Y="60" Width="120" Height="20" Default="yes" Property="PROP_NAME" />
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Text="!(loc.WixUINext)" />
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
</Dialog>
</UI>
</Fragment>
</Wix>
I can read those controls from my custom action DLL (written in C++) when the Next button is clicked, by invoking it as such:
<Publish Dialog="ConfigDlg" Control="Next" Event="DoAction" Value="idCA_NextBtn">1</Publish>
but I also need to pre-populate those edit boxes when the page is first shown (by reading these values from the registry). This may be needed if someone is upgrading or repairing my software.
The question is, how do I do that from my custom action?
For each property that you need read from the registry (for upgrades/repairs) just add a <RegistrySearch> element that populates those properties.

Titanium Alloy ListView Custom Template Click Not Working

I'm using a custom template with views inside on a ListView, but what happens is that the click do not work. I tried to disable touchEnabled on all views inside and still nothing.
In the example below and in the attachment that I am including, there are two ListViews, one with a template with Views inside, and another ListView with a template with no Views inside.
Tested on emulator iOS 10.0.0
[index.xml]
<Alloy>
<Window class="container" layout="vertical">
<Label text="Click is not working on a template with views inside (tested iOS 10.0.0)" top="30"/>
<ListView id="list1" defaultItemTemplate="temp1" height="200" allowsSelection="false" separatorColor="transparent" top="10" onItemClick="testClick">
<Templates>
<ItemTemplate name="temp1" onClick="testClick">
<View backgroundColor="blue">
<View backgroundColor="red" width="60%" height="90%">
<Label bindId="label1"/>
</View>
</View>
</ItemTemplate>
</Templates>
<ListSection headerTitle="Click DON'T WORK!" fontSize="12">
<ListItem label1:text="01" />
<ListItem label1:text="02" />
<ListItem label1:text="03" />
</ListSection>
</ListView>
<ListView id="list2" defaultItemTemplate="temp2" height="200" allowsSelection="false" separatorColor="transparent">
<Templates>
<ItemTemplate name="temp2" onClick="testClick" >
<View backgroundColor="cyan">
</View>
</ItemTemplate>
</Templates>
<ListSection headerTitle="Click WORKS!">
<ListItem />
<ListItem />
<ListItem />
</ListSection>
</ListView>
</Window>
[index.js]
function testClick() {
alert('CLICK');
}
$.index.open();
Download the project if you need:
https://www.dropbox.com/s/t3h6mchsb0e5bdh/ListViewBugTemplateClick.zip?dl=0
You need to use onItemclick the C is lowercase, and it should work but remove this onClick<ItemTemplate name="temp1" onClick="testClick">
<ListView id="list1" defaultItemTemplate="temp1" height="200" separatorColor="transparent" top="10" onItemclick="testClick">
<Templates>
<ItemTemplate name="temp1">
<View backgroundColor="blue">
<View backgroundColor="red" width="60%" height="90%">
<Label bindId="label1"/>
</View>
</View>
</ItemTemplate>
</Templates>
<ListSection headerTitle="Click DON'T WORK!" fontSize="12">
<ListItem label1:text="01" label1:touchEnabled="false" label1:touchable="false" />
<ListItem label1:text="02"/>
<ListItem label1:text="03" />
</ListSection>
</ListView>

Struts 2.3 ignores wildcard actions

I'm setting up an application that uses Struts 2.3 and Tiles 2. Some pages will be heavily Struts driven (e.g. lots of CRUD) while others will be simple, static HTML/JSP pages. I want to set up some actions that handle specific functionality and send all other URLs to a default action, which will check to see if the appropriate static page exists based on the supplied path. If not, a 404 error or some such will be generated instead.
In struts.xml, I have applied a basic configuration that appears like it should work; however, Struts seems to ignore the wildcard action. The non-wildcard actions work just fine.
Here's the struts.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
<!--
You could also set the constants in the struts.properties file
placed in the same directory as struts.xml
-->
<constant name="struts.devMode" value="true" />
<!-- <constant name="struts.mapper.class" value="rest" /> -->
<constant name="struts.action.extension" value="," />
<constant name="struts.enable.SlashesInActionNames" value="true"/>
<constant name="struts.mapper.alwaysSelectFullNamespace" value="false"/>
<constant name="struts.patternMatcher" value="regex" />
<!--
<constant name="struts.convention.action.suffix" value="Controller"/>
<constant name="struts.convention.action.mapAllMatches" value="true"/>
<constant name="struts.convention.default.parent.package" value="rest-default"/>
<constant name="struts.convention.package.locators" value="rest"/>
-->
<package name="base" extends="tiles-default" abstract="yes">
<result-types>
<result-type name="tiles" default="true" class="org.apache.struts2.views.tiles.TilesResult" />
<result-type name="json" class="org.apache.struts2.json.JSONResult"/>
</result-types>
<interceptors>
<interceptor name="json" class="org.apache.struts2.json.JSONInterceptor"/>
<!-- <interceptor name="requestConstants" class="com.ibm.gbs.vdp.constants.ConstantsInterceptor" /> -->
<interceptor-stack name="mainStack">
<interceptor-ref name="defaultStack"/>
<interceptor-ref name="json" />
<!-- <interceptor-ref name="session" /> -->
<!-- <interceptor-ref name="requestConstants" /> -->
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="mainStack" />
<global-results>
<result name="login" type="tiles">login</result>
</global-results>
</package>
<!-- package start -->
<package name="main" extends="base" namespace="/">
<action name="login">
<result type="tiles">login</result>
</action>
<action name="logout" class="com.gswt.common.action.LogoutAction">
<result name="success">login</result>
</action>
<action name="*" class="com.installation.action.PageAction">
<result type="tiles">standard-page</result>
</action>
</package>
<!-- package end -->
<!-- package start -->
<package name="licenses" extends="base" namespace="/licenses">
</package>
<!-- package end -->
<!-- package start -->
<package name="checklists" extends="base" namespace="/checklists">
</package>
<!-- package end -->
<!-- package start -->
<package name="error" extends="base" namespace="/error">
<action name="404">
<result type="tiles">error-404</result>
</action>
</package>
<!-- package end -->
</struts>
And here's an example of the error I receive:
There is no Action mapped for namespace [/] and action name [page] associated with context path []. - [unknown location]
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:185)
org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:553)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:125)
com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:80)
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908)
com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:997)
com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.invokeFilters(DefaultExtensionProcessor.java:1079)
com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:999)
com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3954)
com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:945)
com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1592)
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:191)
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:453)
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:306)
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:277)
com.ibm.ws.ssl.channel.impl.SSLConnectionLink.determineNextChannel(SSLConnectionLink.java:1049)
com.ibm.ws.ssl.channel.impl.SSLConnectionLink$MyReadCompletedCallback.complete(SSLConnectionLink.java:643)
com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1784)
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1656)
What am I missing or doing wrong?
Since you are using advanced wildcards then your action name should be a valid regex expression to match the configuration.
Like so
<action name="{.*}" class="com.installation.action.PageAction">
<result type="tiles">standard-page</result>
</action>

SL 5 out of browser - 1pixel white border?

I have a SL 5 app set to run out of browser.
The OOB setting:
<WindowSettings Title="Thing" Height="497" Width="462" WindowStyle="BorderlessRoundCornersWindow" />
Blend reports the width and height for the UserControl as 463, 500.
When the app runs out-of-browser, it appears there is a 1 pixel line of white along the left and top edges.
Some xaml:
<Grid x:Name="LayoutRoot" Height="500" >
<Border BorderThickness="1" CornerRadius="6" Padding="2" Background="#FFF17A35">
<Grid Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,4,6">
<HyperlinkButton
<!--blah blah -->
</HyperlinkButton>
<HyperlinkButton x:Name="hyperlinkCloseButton"
<!--blah blah -->
</HyperlinkButton>
</StackPanel>
<StackPanel Orientation="Vertical" Grid.Row="2" HorizontalAlignment="Center" Margin="0,2,0,0">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<!--blah blah -->
</StackPanel>
</StackPanel>
<ScrollViewer Width="400" Grid.Row="4" VerticalAlignment="Center" MaxHeight="76">
<TextBlock x:Name="DbgOutput"
Text="{Binding DbgMsgTxt}"
Width="396" TextWrapping="Wrap"/>
</ScrollViewer>
</Grid>
</Border>
</Grid>
Any hints on where the whiteness is coming from?
I Think Fllow This Staps And Helpfull To You My Be
Have New Idea To Implement This
1 . Click On Sliverlight Project
2 . Select Properties option
3 . Select First tab option Like Silverlight
4 . Click On Out-Of-Browser setting Option

List embedded in another list with JSF 2, PrimeFaces and JSTL

On a Facelets page I travel a list to display data in a p:dataTable (a PrimeFaces component).
This list itself contains another list that I travel using a c:forEach (JSTL).
The problem is that the data for the list that c:forEach should handle does not appear. When I access a specific element it works well, but not in a c:forEach.
Is it not possible to use an inner loop variable embedded in another loop?
Here's the page's code:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<body>
<ui:composition template="./template_utilisateur.xhtml">
<ui:define name="content">
<h:form prependId="false" id="form">
<p:growl id="growl" showDetail="true"/>
<p:dataTable id="carsTable" var="car" value="#{histCommController.lc}" rowKey="#{car.id}"
selectionMode="single" >
<f:facet name="header">
Expand rows to see detailed information
</f:facet>
<p:column style="width:4%">
<p:rowToggler/>
</p:column>
<p:column style="width:48%">
<f:facet name="header">
id
</f:facet>
<h:outputText value="#{car.id}" />
</p:column>
<p:column style="width:48%">
<f:facet name="header">
date envoi
</f:facet>
<h:outputText value="#{car.dateEnvoi}" />
</p:column>
<p:rowExpansion id="expanssion">
<h:panelGrid id="display" columns="2" cellpadding="4" style="width:300px;"
styleClass=" ui-widget-content grid">
<h:outputText value="Model:" />
<h:outputText value="#{car.id}" />
<h:outputText value="Year:" />
<h:outputText value="#{car.etat}" />
<h:outputText value="Manufacturer:" />
<h:outputText value="#{car.dateEnvoi}" />
<h:outputText value="Color:" />
<h:outputText value="#{car.dateLivraisonRecommande}" />
<h:outputText value="Fichiers : " />
<h:outputText value="::::::::::::" />
<h:outputText value="Fichiers 1 : " />
<h:outputText value="#{car.listFichiers.get(0).nom}" />
<c:forEach var="jjjjj" items="#{car.listFichiers}">
<h:outputText value="nom fichier 1 : " />
<h:outputText value="#{jjjjj.nom}" />
</c:forEach>
</h:panelGrid>
</p:rowExpansion>
</p:dataTable>
</h:form>
</ui:define>
</ui:composition>
</body>
</html>
The problem occurs because you are mixing so-called build-time and render-time constructs.
build-time happens first, and everything that happens there can not make use of things that don't exist until render-time, which happens after.
In your case, the JSTL forEach is build-time, while the car var is made available by the render-time dataTable. The solution is to use a render-time construct for the inner looping. The best candidate for this is ui:repeat.
See also
Beware the Difference Between Build-Time and Render-Time Tags in Facelets