In my Code, actually the fontsize should change, if its hovered but it doesnt. Why not?
Because if i hover the the Label, the fontsize should switch to 20. Does anyone know where the problem is? Normally you should expect the font to be resized after its hovered, but it doesnt resize.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" applicationDPI="160">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
<s:ArrayList id="employeList">
<fx:String>Mein Buch, was geht</fx:String>
<fx:String>Der Graf von Monte Christo</fx:String>
<fx:String>Hier steht das neu buche</fx:String>
<fx:String>hmmm</fx:String>
</s:ArrayList>
<s:ArrayList id="testList">
<fx:Object test="try" test2="this"></fx:Object>
<fx:Object test="out" test2="plz"></fx:Object>
</s:ArrayList>
</fx:Declarations>
<s:DataGroup dataProvider="{(testList)}" >
<s:layout>
<s:VerticalLayout>
</s:VerticalLayout>
</s:layout>
<s:itemRenderer>
<fx:Component>
<s:ItemRenderer>
<s:states>
<s:State name="normal">
</s:State>
<s:State name="hovered" >
</s:State>
<s:State name="selected" >
</s:State>
</s:states>
<s:BorderContainer>
<s:layout >
<s:HorizontalLayout
horizontalAlign="center" paddingBottom="80">
</s:HorizontalLayout>
</s:layout>
<s:Label text="{data.test} {data.test2}"
fontSize.hovered="20" fontSize.selected="30">
</s:Label>
<s:CheckBox>
</s:CheckBox>
</s:BorderContainer>
</s:ItemRenderer>
</fx:Component>
</s:itemRenderer>
</s:DataGroup>
</s:Application>
In your code, you write
<s:Label
text="{data.test} {data.test2}"
fontSize.hovered="20" fontSize.selected="30">
which specifies what the font is for the hovered and select state, however you do not specify what the font is for the normal state.
Since it is not specified in the above code what the font is for the normal state, there may not be an obvious difference between the font in the normal state vs. the font in the hovered state.
I suggest you start by adding another parameter:
fontSize="10"
That will apply when the other fontSize.state parameters do not apply.
Related
this is what I created in my TiledMap Editor:
But when I try to display it in simulator, it becomes this:
You can see some of tile images are missed, some are wrong(the place where dirt.png should be become wall.png instead). I don't know why this happened. I follow the tutorial and add the following code in the HelloWorld project.
// create a TMX map
auto map = TMXTiledMap::create("tile/test.tmx");
addChild(map);
the content of test.tmx:
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" orientation="orthogonal" renderorder="right-down" width="10" height="10" tilewidth="36" tileheight="36" nextobjectid="5">
<tileset firstgid="1" name="test" tilewidth="36" tileheight="36">
<tile id="0">
<image width="36" height="36" source="dirt.png"/>
</tile>
<tile id="1">
<image width="36" height="36" source="floor.png"/>
</tile>
<tile id="2">
<image width="36" height="36" source="wall.png"/>
</tile>
</tileset>
<layer name="Tile Layer 1" width="10" height="10">
<data encoding="base64" compression="gzip">
H4sIAAAAAAAAA2NkYGBgRMMwgM7GhRnQaEJmMaCJ4zILXS8+dbjsxOY+XO4g5FZ0M0GAiQBGV49PDwgAAKCoyOyQAQAA
</data>
</layer>
<objectgroup name="Object Layer 1">
<object id="1" name="SpawnPoint" x="125" y="133" width="67" height="62"/>
</objectgroup>
</map>
Could any one give me a hand?
okay... I have found why....
There are limitations which cocos2d-x support Tied Map Editor.
in this page, http://www.cocos2d-x.org/wiki/TileMap, it says:
Tiles:
- Embedded tiles are NOT supported (i.e., tilesets with embedded images).
- Only embedded tilesets are supported (i.e., the tileset is embedded, but not its images).
- supports at most 1 tileset per layer.
So.... each of tilesets MUST only contain one image.
And... each of layer MUST only contain one tilesets.
If you don't follow the rule while editing map in the Tied Map Editor. The result will become chaos like mine.
How to get iOS 7 action bar look in flex mobile application, I want my action bar to be completely flat and semi transparent too, I have seen few posts; those talks about making action bar flat by custom skin but no one talks about transparency.... any help or point to right direction would be greatly appreciated....
All you need to do is set the alpha property on your custom skin:
From Adobe's help documentation:
I added a transparent fill to the button's background/border <s:Rect>
<?xml version="1.0" encoding="utf-8"?>
<!-- SparkSkinning/GlobalVariableAccessorExample.mxml -->
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark">
<fx:Script>
public var myLabelString:String = "Hello World";
</fx:Script>
<s:Button skinClass="mySkins.GlobalVariableAccessorSkin"/>
</s:Application>
<?xml version="1.0" encoding="utf-8"?>
<!-- SparkSkinning\mySkins\GlobalVariableAccessorSkin.mxml -->
<s:Skin
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark"
minWidth="21" minHeight="21">
<fx:Metadata>
[HostComponent("spark.components.Button")]
</fx:Metadata>
<fx:Script>
import mx.core.FlexGlobals;
[Bindable]
private var localString:String = FlexGlobals.topLevelApplication.myLabelString;
</fx:Script>
<!-- Specify one state for each SkinState metadata in the host component's class -->
<s:states>
<s:State name="up"/>
<s:State name="over"/>
<s:State name="down"/>
<s:State name="disabled"/>
</s:states>
<s:Rect
left="0" right="0"
top="0" bottom="0"
width="69" height="20"
radiusX="2" radiusY="2">
<s:stroke>
<s:SolidColorStroke color="0x000000" weight="1"/>
</s:stroke>
<!--
This section added to demonstrate
-->
<s:fill>
<s:SolidColor color="0x999999" alpha="0.5"/>
</s:fill>
<!-- ----------------------- -->
</s:Rect>
<s:Label id="labelDisplay"
text="{localString}"
horizontalCenter="0" verticalCenter="1"
left="10" right="10" top="2" bottom="2">
</s:Label>
</s:Skin>
I have an issue with using p:outputLabel when used with composite component. I have composite component with p:inputText field (I removed irrelevant parts from component):
<cc:interface>
<cc:editableValueHolder name="myInput" targets="myInput"/>
<cc:attribute name="required" required="true" type="java.lang.Boolean" default="false"/>
</cc:interface>
<cc:implementation>
<p:inputText id="myInput" required="#{cc.attrs.required}"/>
</cc:implementation>
Now, I wont to use this component with p:outputLabel:
<p:outputLabel for="myComponent:myInput" value="#{resources['myLabel']}:"/>
<my:myComponent id="myComponent" required="#{myBean.required}"/>
Everything works fine, required validation, message is displayed as well, but there is no * sign on label, as there is when I connect label directly to p:inputText component. If I, on the other hand, hardcode required="true" on p:inputText everything works fine.
I debugged through org.primefaces.component.outputlabel.OutputLabelRenderer and discovered that component is recognized as UIInput, but input.isRequired() returns false. Farther debugging discovered that required attribute isn't yet defined on component, so it returns false as default value i UIInput:
(Boolean) getStateHelper().eval(PropertyKeys.required, false);
Also, if I just move p:outputLabel inside composite component everything works fine. Like EL is evaluated later inside composite component?
I'm using Primefaces 3.5 with Mojarra 2.1.14
This is, unfortunately, "by design". The evaluation of the #{} expressions is deferred to the exact moment of the access-time. They're unlike "standard" EL ${} in JSP not evaluated at the exact moment they're been parsed by the tag handler and "cached" for future access during the same request/view. At the moment the <p:outputLabel> is rendered, and thus the #{cc.attrs.required} as referenced by UIInput#isRequired() needs to be evaluated, there's no means of any #{cc} in the EL context. So any of its attributes would not evaluate to anything. Only when you're sitting inside the <cc:implementation>, the #{cc} is available in the EL context and all of its attribues would thus successfully evaluate.
Technically, this is an unfortunate corner case oversight in the design of <p:outputLabel>. Standard JSF and EL are namely behaving as specified. Basically, the presentation of the label's asterisk depending on the input's required attribute should be evaluated the other way round: at the moment the <p:inputText> inside the composite is to be rendered or perhaps even already when it's to be built. Thus, the label component should not ask the input component if it's required, but the input component should somehow notify the label component that it's required. This is in turn hard and clumsy (and thus inefficient) to implement.
If moving the label to inside the composite is not an option, then your best bet is to create a tag file instead of a composite component around the input component. It only requires some additional XML boilerplate.
/WEB-INF/tags/input.xhtml:
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:p="http://primefaces.org/ui"
>
<c:set var="id" value="#{not empty id ? id : 'myInput'}" />
<c:set var="required" value="#{not empty required and required}" />
<p:inputText id="#{id}" required="#{required}"/>
</ui:composition>
/WEB-INF/my.taglib.xml:
<?xml version="1.0" encoding="UTF-8"?>
<facelet-taglib
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
version="2.0"
>
<namespace>http://example.com/my</namespace>
<tag>
<tag-name>input</tag-name>
<source>tags/input.xhtml</source>
</tag>
</facelet-taglib>
/WEB-INF/web.xml:
<context-param>
<param-name>javax.faces.FACELETS_LIBRARIES</param-name>
<param-value>/WEB-INF/my.taglib.xml</param-value>
</context-param>
Usage:
<html ... xmlns:my="http://example.com/my">
...
<p:outputLabel for="myInput" value="#{resources['myLabel']}:" />
<my:input id="myInput" required="#{myBean.required}" />
I just did a quick test and it works fine for me.
See also:
When to use <ui:include>, tag files, composite components and/or custom components?
I am having some problems regarding the use of locallang.xml
I have this:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3locallang>
<meta type="array">
<type>module</type>
<description>Language labels for BE plugin</description>
</meta>
<data type="array">
<languageKey index="default" type="array">
<label index="mlang_testtext">This is a test text to be translated</label>
</languageKey>
<languageKey index="es" type="array">
<label index="mlang_testtext">Esto es un texto de prueba para ser traducido</label>
</languageKey>
</data>
</T3locallang>
Inside fluid template, I can use
<f:translate key="mlang_testtext" />
But If I try
{LLL:mlang_testtext}
All I get is the text Array
Also, if I try both of them inside a partial template, neither of those ones works.
EDIT: There are places where I can't use <f:translate .../> for example in button labels so I need the other form working too
What am I missing?
Check /typo3/sysext/fluid/Classes/ViewHelpers/TranslateViewHelper.php for sample of correct inline usage, so for an example setting your label as a default value of the input field would look like this:
<f:form.textfield name="myTextBox" value="{f:translate(key: 'mlang_testtext')}" />
In case user downloads particular type of file (let's say .doc), I should show one more item (i.e. possible action) in addition to Save and Open at unknownContentType Firefox dialog.
How can I do it?
Upd. Looking at FlashGot addon sources, I've extracted the following:
chrome.manifest
overlay chrome://mozapps/content/downloads/unknownContentType.xul chrome://flashgot/content/DMOverlayFx.xul
overlay chrome://global/content/nsHelperAppDlg.xul chrome://flashgot/content/DMOverlayMoz.xul
Why do they have two overlays? What second does? And, how to understand that user chosen my option?
DMOverlayFx.xul
<?xml version="1.0" encoding="UTF-8"?>
<overlay id="DMOverlayFF"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="Common.js"/>
<script type="application/x-javascript" src="DMOverlay.js"/>
<radiogroup id="mode" >
<vbox insertbefore="save" id="synoextcontainer" flex="1">
<hbox flex="1">
<radio id="synoext-dmradio" label="Download with Synology NAS" />
</hbox>
</vbox>
</radiogroup>
</overlay>
DMOverlayMoz.xul
<?xml version="1.0" encoding="UTF-8"?>
<overlay id="DMOverlayMoz"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="Common.js"/>
<script type="application/x-javascript" src="DMOverlay.js"/>
<radiogroup id="mode" >
<hbox position="3" >
<radio id="synoext-dmradio" label="Download with Synology NAS"/>
</hbox>
</radiogroup>
</overlay>
The important file to overlay is unknownContentType.xul. You can see an example here: http://code.google.com/p/firedownload/source/browse/chrome/content/unknownContentType-overlay.xul. This adds a new checkbox to the dialog, but you can use the same approach to add a new radio button. You'll want to include a new JS file in the overlay (like unknownContentType-overlay.js in this example) where you can override the standard processing of the radio buttons. Process your new option and hand off the other options to the existing implementation (look at helperApps.js to see how the standard processing works).