I'm quite experienced in XAML/WPF but am new to Flex/Flex4. I'm trying to build a list of animatable objects with a sub-list of their animations using ListBase and inline ItemRenderers. Can someone shed any light on why the inner ListBase gives me the following error, while the outer list doesn't?
'spark.components.supportClasses.ItemRenderer' is not assignable to the default property, 'dataProvider', of type 'mx.collections.IList'.
The source code:
<s:ListBase dataProvider="{AnimationList}">
<s:itemRenderer>
<fx:Component>
<s:ItemRenderer>
<s:VGroup>
<s:Label id="labelDisplay" text="{data.Name}"/>
<s:ListBase dataProvider="{data.Animations}">
<s:ItemRenderer>
<fx:Component>
<s:ItemRenderer>
<s:HGroup>
<mx:Button label="play" />
<mx:Label text="{data.Name}"/>
</s:HGroup>
</s:ItemRenderer>
</fx:Component>
</s:ItemRenderer>
</s:ListBase>
</s:VGroup>
</s:ItemRenderer>
</fx:Component>
</s:itemRenderer>
</s:ListBase>
You're using <s:ItemRenderer> (so it is an instance of ItemRenderer class assigned to ListBase's default property which is dataProvider). I suppose it is typo and you're going to use property <s:itemRenderer> as in outer list. Take a look at first letter's case. In ActionScript all the classes starts with capitals.
Related
Is there anything wrong I am doing, or maybe missing something?
I tried with different VAST testers online but it doesn't work firing one of the Viewable Impression (Viewable, NotViewable, ViewUndetermined) (the example.com/track/impression) not firing at all.
Code:
<VAST version="4.0" xmlns="http://www.iab.com/VAST">
<Ad id="20004" sequence="1" conditionalAd="false">
<InLine>
<AdSystem version="4.0">iabtechlab</AdSystem>
<Error>http://example.com/error</Error>
<Extensions>
<Extension type="iab-Count">
<total_available><![CDATA[ 2 ]]></total_available>
</Extension>
</Extensions>
<Impression id="Impression-ID">http://example.com/track/impression2</Impression>
<ViewableImpression id="1543">
<Viewable>
<![CDATA[http://example.com/track/impression]]>
</Viewable>
<NotViewable>
<![CDATA[http://search.iabtechlab.com/error?errcode=102&imprid=s5-ea2f7f298e28c0c98374491aec3dfeb1&ts=1243]]>
</NotViewable>
<ViewUndetermined>
<![CDATA[http://search.iabtechlab.com/error?errcode=102&imprid=s5-ea2f7f298e28c0c98374491aec3dfeb1&ts=1243]]>
</ViewUndetermined>
</ViewableImpression>
<Pricing model="cpm" currency="USD"><![CDATA[ 25.00 ]]></Pricing>
<AdTitle><![CDATA[VAST 4.0 Pilot - Scenario 5]]></AdTitle>
<Creatives>
<Creative id="5480" sequence="1" adId="2447226">
<CompanionAds>
<Companion id="1232" width="100" height="150" assetWidth="250" assetHeight="200" expandedWidth="350" expandedHeight="250" adSlotID="3214" pxratio="1400">
<StaticResource creativeType="image/png"><![CDATA[https://www.iab.com/wp-content/uploads/2014/09/iab-tech-lab-6-644x290.png]]></StaticResource>
<CompanionClickThrough><![CDATA[https://iabtechlab.com]]></CompanionClickThrough>
</Companion>
</CompanionAds>
<UniversalAdId idRegistry="Ad-ID" idValue="8465">8465</UniversalAdId>
</Creative>
<Creative id="5480" sequence="1" adId="2447226">
<Linear>
<TrackingEvents>
<Tracking event="start">http://example.com/tracking/start</Tracking>
<Tracking event="firstQuartile">http://example.com/tracking/firstQuartile</Tracking>
<Tracking event="midpoint">http://example.com/tracking/midpoint</Tracking>
<Tracking event="thirdQuartile">http://example.com/tracking/thirdQuartile</Tracking>
<Tracking event="complete">http://example.com/tracking/complete</Tracking>
<Tracking event="progress" offset="00:00:10">http://example.com/tracking/progress-10</Tracking>
</TrackingEvents>
<Duration>00:00:16</Duration>
<MediaFiles>
<MediaFile id="5241" delivery="progressive" type="video/mp4" value="100" bitrate="2000" width="200" height="200" minBitrate="1500" maxBitrate="2500" scalable="1" maintainAspectRatio="1" codec="H.264"><![CDATA[https://iabtechlab.com/wp-content/uploads/2016/07/VAST-4.0-Short-Intro.mp4]]></MediaFile>
</MediaFiles>
<VideoClicks>
<ClickThrough id="blog"><![CDATA[https://iabtechlab.com]]></ClickThrough>
</VideoClicks>
</Linear>
<UniversalAdId idRegistry="Ad-ID" idValue="8465">8465</UniversalAdId>
</Creative>
</Creatives>
<Description><![CDATA[This is sample companion ad tag with Linear ad tag. This tag while showing video ad on the player, will show a companion ad beside the player where it can be fitted. At most 3 companion ads can be placed. Modify accordingly to see your own content. ]]></Description>
</InLine>
</Ad>
</VAST>
Any help would be much appreciated.
I have created a custom control (hidden text box with some predefined value), where I want to set visibility=false(), controlName="Mycustom", default value="This is my custom control" in XBL file. So that whenever we use that custom control from Orbeon Form Builder, it will come with all default values with no need to set anything.
XBL:
<xbl:xbl xmlns:xh="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:saxon="http://saxon.sf.net/"
xmlns:xbl="http://www.w3.org/ns/xbl"
xmlns:exf="http://www.exforms.org/exf/1-0"
xmlns:xxbl="http://orbeon.org/oxf/xml/xbl">
<metadata xmlns="http://orbeon.org/oxf/xml/form-builder">
<display-name lang="en">Epson Custom Controls</display-name>
</metadata>
<xbl:binding id="fr-custom" element="fr|custom" >
<metadata xmlns="http://orbeon.org/oxf/xml/form-builder">
<display-name lang="en">My Custom Control</display-name>
<icon lang="en">
<small-icon>/forms/orbeon/builder/images/input.png</small-icon>
<large-icon>/forms/orbeon/builder/images/input.png</large-icon>
</icon>
<templates>
<bind xxf:whitespace="trim"/>
<view>
<xf:input id="myCustom" ref="" xmlns="">
<xf:label>My Custom lable</xf:label>
<xf:hint ref=""/>
<xf:help ref=""/>
<xf:alert ref=""/>
</xf:input>
</view>
</templates>
</metadata>
</xbl:binding>
</xbl:xbl>
Using above control I want hidden text box with value='This is my custom control' and its control name should be Mycustom.
Update
I have tried with below changes, but it is not working
<templates>
<bind xxf:whitespace="trim" relevant="false()" xxf:default="'This is my custom control'"/>
<view>
<xf:input id="myCustom" ref="" xmlns="">
<xf:label>Success Message</xf:label>
<xf:hint ref=""/>
<xf:help ref=""/>
<xf:alert ref=""/>
</xf:input>
</view>
</templates>
With above changes now its working (control is hidden with some default value).
Can you please let me know how to put if condition
properties-local.xml:
<property as="xs:string" name="oxf.fr.detail.process.save-final-custom.*.*">
require-uploads
then validate-all
then save
if({xxf:instance('fr-form-instance')//customMessage} != null)
{
then success-message(message = "{xxf:instance('fr-form-instance')//customMessage}")
}
recover error-message("database-error")
</property>
Here I want to override this success-message if it properly configured from backed. If it's value is null then want to show OOTB message(don't override).
Update2
Integrated changes in Hybris. below are the changes I have made in Hybris
Create XBL > orbeon > custom > custom.xbl
<bind xxf:whitespace="trim" relevant="false()" xxf:default="'This is my custom control'"/>
Issue :- When we select custom control, it will bind without any lable/message/visibility etc. But if I refresh left control panel then label start appearing on the form. but still default message is not set.
Let's take the items you mentioned one by one:
visibility="false()" – I imagine you're referring to the relevant attribute in XForms, instead of the visibility attribute. (Form Builder calls this "visibility", because this is what it is, but in XForms, the attribute is relevant.) This can be done by having inside the <templates> a <bind relevant="false()"/>.
controlName="Mycustom" – You can't set the id of the control in XBL. (BTW, when using Form Builder, the XForms id is inferred from the control name defined by the form author in Form Builder.) The id is set by whoever uses the control, not whoever defines it, otherwise, for one, this would prevent you from having multiple instances of that control in the form.
default value="This is my custom control" – As in #1 above, you can do this with <bind xxf:default="'This is my custom control'">. Note the added single quotes, as the value of xxf:default is an XPath expression.
I am attempting to import data into Orchard CMS. I have a custom type, made up of parts and fields, and I am using the ImportExport module. I have exported some data from Orchard to ensure the XML schema is correct, but when importing, the only field that seems to be populating is the TitlePart Title. I have randomly generated a GUID for the identifier of each record. Orchard 1.4, ImportExport 1.4.
Example of one item of data:
<Orchard>
<Recipe>
<Name>Data Import</Name>
<Author>myaccount</Author>
</Recipe>
<Data>
<OurPropertiesDivision Id="/Identifier=94eff3237c714f98b021905c33d25ea9" Status="Published">
<LinkField.Link Text="This is a link" Url="http://stackoverflow.com" />
<MediaPickerField.ImageOne Url="~/test.jpg" Width="100" Height="100" />
<MediaPickerField.ImageTwo Url="~/test2.jpg" Width="100" Height="100" />
<MediaPickerField.ImageThree Url="~/test3.jpg" Width="100" Height="100" />
<TitlePart Title="Test Title" />
<CommonPart Owner="/User.UserName=myaccount" CreatedUtc="2012-04-04T23:03:39Z" PublishedUtc="2012-04-04T23:03:39Z" ModifiedUtc="2012-04-04T23:03:39Z" />
<IdentityPart Identifier="94eff3237c714f98b021905c33d25ea9" />
</OurPropertiesDivision>
</Data>
</Orchard>
This results in the following when looking at the imported entry:
Content list:
Edit screen:
The only field that is making it through the import is the TitlePart. How can I make this work in a way that I can bulk insert any type of field or part with data? I would also like to capture the Container for the Containable part.
EDIT: Adding content type metadata
<?xml version="1.0"?>
<!--Exported from Orchard-->
-<Orchard>
-<Recipe>
<Name>Generated by Orchard.ImportExport</Name>
<Author>myaccount</Author>
</Recipe> -<Metadata>
-<Types>
-<OurPropertiesDivision DisplayName="Our Properties - Division" ContentTypeSettings.Draftable="True" ContentTypeSettings.Creatable="True">
<CommonPart DateEditorSettings.ShowDateEditor="False" OwnerEditorSettings.ShowOwnerEditor="False"/>
<TitlePart/>
<OurPropertiesDivision/>
<ContainablePart/>
<IdentityPart/>
</OurPropertiesDivision>
</Types> -<Parts>
<CommonPart ContentPartSettings.Attachable="True"/> <TitlePart ContentPartSettings.Attachable="True"/> -<OurPropertiesDivision ContentPartSettings.Attachable="True">
<ImageOne.MediaPickerField DisplayName="Image One" MediaPickerFieldSettings.Required="False" HtmlFieldSettings.FlavorDefault="html"/>
<ImageTwo.MediaPickerField DisplayName="Image Two" MediaPickerFieldSettings.Required="False" HtmlFieldSettings.FlavorDefault="html"/>
<ImageThree.MediaPickerField DisplayName="Image Three" MediaPickerFieldSettings.Required="False" HtmlFieldSettings.FlavorDefault="html"/>
<Content.HtmlField DisplayName="Content" HtmlFieldSettings.FlavorDefault="html"/>
<Link.LinkField DisplayName="Link" HtmlFieldSettings.FlavorDefault="html" LinkFieldSettings.LinkTextMode="Required" LinkFieldSettings.TargetMode="NewWindow" LinkFieldSettings.Required="True"/>
</OurPropertiesDivision> <ContainablePart ContentPartSettings.Attachable="True"/> <IdentityPart ContentPartSettings.Attachable="True"/>
</Parts>
</Metadata>
</Orchard>
I ended up analyzing the database inserts generated by the admin, and manually importing the data in SQL.
I'm currently working on this website (http://www.jowannes.com/thomasschoof/flash/LauraBarsby.html) and I created a little gallery. When you press the image it becomes the background of the website. Now this has some problems if the background is white and you look at the other pages again, you can't read the text any more.
I would like it to be when you go back to another page, the background changes to it's original one. So basically I'm looking for the page (component?) load event or something alike, but I can't seem to find it.
CreationCompleted doesn't work for this, because when you navigate to it the second time it's already created, this the background doesn't change.
I'm setting the background like this:
Main page:
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:component="component.*">
<fx:Script>
<![CDATA[
public function changeBackground(bitmapFillObj:BitmapFill):void
{
backgroundContainer.backgroundFill = bitmapFillObj;
}
]]>
</fx:Script>
<fx:Declarations>
<s:BitmapFill id="_bg1" source="#Embed('assets/bg1.jpg')"/>
<s:BitmapFill id="_bg2" source="#Embed('assets/bg2.jpg')"/>
</fx:Declarations>
<s:BorderContainer id="backgroundContainer" width="100%" height="100%" backgroundImage="#Embed('assets/bg1.jpg')" borderAlpha="0">
<component:home/>
</s:BorderContainer>
</s:WindowedApplication>
Component:
<fx:Script>
<![CDATA[
import mx.core.FlexGlobals;
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:layout>
<s:HorizontalLayout/>
</s:layout>
<s:Button label="click to show bg 1" click="FlexGlobals.topLevelApplication.changeBackground(FlexGlobals.topLevelApplication._bg1)"/>
<s:Button label="click to show bg 2" click="FlexGlobals.topLevelApplication.changeBackground(FlexGlobals.topLevelApplication._bg2)"/>
I also have the problem that the images become stretched, because I can't set the fillmode NOR can I center them, any ideas for this?
I hope somebody can help me, Thanks
Thomas
I found the solution: In a viewstack you have a handler called change=, I just put my method in there and it worked.
This is my code:
<controls:AdvancedDataGrid id="adg" dataChange="adg_dataChangeHandler(event)">
<!-- other stuff goes here -->
</controls:AdvancedDataGrid>
and in my ActionScript code:
protected function adg_dataChangeHandler(event:FlexEvent):void
{
trace(1);
}
When I edit a cell in advancedDataGrid (making the columns editable of course) it never dispatches an event. Or, in other words, my function is never called. How can I fix this?
I think that the better option for my scenario is to use an itemEditor, that has a listener put on the change event. Code looks like :
<controls:AdvancedDataGrid id="adg">
<controls:groupedColumns>
<adgs:AdvancedDataGridColumn headerText="A" wordWrap="true" dataField="name" editable="false" itemEditor="Aaa"/>
</controls:groupedColumns>
</controls:AdvancedDataGrid>
and the item editor class is here :
<?xml version="1.0" encoding="utf-8"?>
<mx:TextInput xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" change="textinput1_changeHandler(event)" restrict="0-9">
<fx:Script>
<![CDATA[
protected function textinput1_changeHandler(event:Event):void
{
trace("ha");
}
]]>
</fx:Script>
</mx:TextInput>