I have a checkbox label that needs to be about 50 characters long, but it's being truncated at 13 characters.
How do I code it to allow longer text in the label please?
Thank you
You can follow two different ways:
The first: Try in your checkBox (s: or mx:) to increase the width property
<s:CheckBox id="myChk" width="100" />
<mx:CheckBox id="myChk" width="100" />
The second: You can wrap your checkbox in a FormItem (s: or mx:) so, you can manage the width of FormItem and your checkbox manage only the tick select.
<s:FormItem id="myItem" label="AAAAAAAAAAAAAAAAAAAAAAAAAAAAA">
<s:CheckBox id="myChk" />
</s:FormItem>
Related
I have one textinput and beside that there is datefield which is editable="true".
Now, when i enter something in textinput and press tab then it focus on datefield but, not remove focus from <s:TextInput.
This happens only in internet explorer. Not any other browser having that issue.
I have just simple textinput and datefield.
<s:TextInput width="100" />
<mx:DateField width="100" editable="true" selectedDate="{new Date()}" />
Change that editable part to false and you are good to go , try listening to tab event (Keyboard and then change the focus)
I have a TextArea component as follows:
<mx:TextArea
id="textArea"
width="100%"
height="100%"
editable="false"
verticalScrollPolicy="on"
/>
My issue is that I populate the TextArea with a huge amount of text that needs to be scrolled through. The vertical scrollbar exists, but is disabled. Even though it is disabled the user can scroll using the mouse scroll.
Note: If I change the text later the scrollbar reenables.
The fix turned out simply using the spark component instead of mx component:
<s:TextArea
id="textArea"
width="100%"
height="100%"
editable="false"/>
I Want to get selected checkbox value from checkbox Key property on Action Class as List.
My code look like this
<s:form action="SearchEmail">
<s:iterator value="ls">
<s:checkbox name="chk" key="number" />
</s:iterator>
<s:submit value="Go"/>
</s:form>
<s:iterator value="ls" status="stat">
<s:checkbox name="chk[%{#stat.index}]" key="number" />
<%-- <s:property value="number"/> --%>
</s:iterator>
The output is:
Value of CheckBox:{0=true, 1=false, 2=true}
But I need value in String format I don't need Index I need Value of Key property of Checkbox. I want to get the value of Selected Property.
<s:property value="number"/>
<s:checkbox fieldValue="%{number}" name="chk" key="number"> </s:checkbox> <!-- key="number" -->
</s:iterator>
wow it's working with above code.Something Magic. Thank every one to letting me resolve it on my own.
here 'var' attribute makes the sense
<s:iterator value="ls" var="val">
<s:checkbox name="%{val}" id="%{val}" label="%{val}"></s:checkbox>
</s:iterator>
I always end up hard-coding things that appear to be so simple...
This is the scenario:
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<s:Form>
<s:layout>
<s:TileLayout requestedColumnCount="2"
verticalAlign="middle" />
</s:layout>
<s:FormItem label="Label with long text">
<s:TextInput />
</s:FormItem>
<s:FormItem label="Label with long text">
<s:Label text="something" />
</s:FormItem>
<s:FormItem label="shortLabel">
<s:TextInput />
</s:FormItem>
<s:FormItem label="shortLabel">
<s:Label text="something" />
</s:FormItem>
</s:Form>
</s:Application>
Is there a simple way to give each tile layout column a FormLayout?
In form layout, all the first items on FormItem containers are aligned.
You have overridden form layout that's why elements are not aligned correctly.
As I understand you need multi columns form. Flex doesn't support such functionality now.
Possible solutions are:
1. Use 2 forms in container. In such case form items would be aligned.
2. Define form items sizes.
3. Write you own new multi column form layout and share it.
Spark FormLayout extends VerticalLayout, changing its inheritance to TileLayout in customLayout class(say FormTileLayout) worked for my project.
I have 4 buttons, all of them have the same width.
<s:Button id="btn1" width="{btnWidth}" />
<s:Button id="btn2" width="{btnWidth}" />
<s:Button id="btn3" width="{btnWidth}" />
<s:Button id="btn4" width="{btnWidth}" />
Is it possible to set their width with Style, something like this:
s|Button{
width: btnWidth;
}
I tried it, but auto-complete isn't working, which leads me to think that there's something wrong with the syntax. Basically my goal is to not have the width property set specifically for all 4.
It won't work out of the box because width is a property of button, not a style. You can only specify styles in your stylesheet.
However, what you can do is extending Button and add a style that controls the width of your button.