Apache Royale : what is Jewel DataGrid rowHeight property equivalent on SDK 0.9.8#2556 - datagrid

I moved from SDK 0.9.7 to SDK 0.9.8#2556 to be "up to date".
It seems that rowHeight property on Jewel Datagrid is no longuer available.
I didn't find how to set default row height. (I want all my row having 64 pixels height).
Does I need a bead or add an itemrenderer to set an height ?
Any help would be apprecied
Regards

We removed APIs from TLC components that are available in PresentationModels to avoid duplicating APIs and add extra size.
This is an example from Tour De Jewel that uses rowHeigh` in DataGridPresentationModel:
<j:DataGrid localId="dg4" height="205"
change="dataGridChange(event.target as DataGrid, lb4)"
dataProvider="{productModel.productList}">
<j:columns>
<j:DataGridColumn label="Images" dataField="image" columnWidth="100"
itemRenderer="itemRenderers.ImageDataGridItemRenderer"/>
<j:DataGridColumn label="Title" dataField="title" columnWidth="140"/>
<j:DataGridColumn label="Sales" dataField="sales" columnWidth="80" align="right"/>
</j:columns>
<j:beads>
<j:DataGridPresentationModel rowHeight="54"/>
</j:beads>
</j:DataGrid>

Related

Display HTML text in the Adobe Air Label

I am trying to display HTML text inside the Label in my Adobe Air mobile application, so far
I realized that Label doesn't support HTML, I went through the few solutions I found so far on the web:
Instead of Label - User TextArea and then use:
StyleableTextField(message.textDisplay).htmlText = messageText;
and in the TextArea declaration - specify mobile skin
<s:TextArea editable="false" selectable="false" skinClass="spark.skins.mobile.TextAreaSkin" id="message" x="0" y="0" width="100%" height="100%" paddingLeft="5" paddingRight="5" textAlign="left"/>
First of all, HTML still doesn't work, instead of converted HTML it just shows me ..... garbage, but even if it would have worked - TextArea component looks different than Label and doesn't feet in the design I am implementing.
User RichText component - unfortunately it's not supported in mobile apps
Any other ideas?
Yes, HTML is not supported in the Label and TextArea components for Spark (it was supported in Halo, or the mx components).
The only Flex components that officially do support it are RichText and RichEditableText. The skins for these components are not mobile optimized, but they run on mobile just fine. You may run into some speed issues when using massive amounts of it, but you can still use them (as you can with most, if not all, other components that aren't mobile optimized).

GroubBox in Flex 3 with heading

I need to have a group box in flex 3 - simple border with a heading at the top but the heading at the top should not have any border line through it.
I searched on the Net and the closest that I could get with source is
http://keg.cs.uvic.ca/flexdevtips/titledborder/srcview/
But the problem with this is that I can’t view in design mode what is on the group box. Does anyone know how to fix this?
Then I decided to go with canvases and an input box
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*">
<mx:TextInput
text="This should be my label"
x="124" y="72"
width="166" height="32"
borderStyle="solid"
fontWeight="bold"
color="#003366" backgroundColor="#D81010"/>
<mx:Canvas x="107" y="88" width="263" height="200" borderStyle="solid" label="Testst">
</mx:Canvas>
</mx:Application>
But I can't seem to get the Textinput to be ontop of the canvas. There is a line through the box as in the below picture
Does anyone know how to resolve this or have a better idea?
thanks
What you are looking for is a component equivalent to "fieldset" in HTML. It would be easier to use create component for better styling control. For Flex 2/3, you may use jwopitz-lib; but if you could use Flex 4 or above, try the ShinyLib component (specifically the FieldSet class and FieldSet skin). It would be easier if you could migrate the application to Flex 4 or the latest Flex, you would be exposed to a lot more components.
To get a custom component to work in design mode, you need to compile the code into a SWC library. Then reference the SWC library in your application project. I've never bothered to do this, I imagine you may get mixed results. I haven't bothered w/design mode in over 5 years :)
The reason the "window" component (in the URL that you linked to in the question) works in design mode is that it extends the Flex component TitleWindow. Since it extends an existing Flex component, I am assuming design mode knows how to render it.

What is the state of a TextArea in the Flex when we could not enter the cursor in it and no text is passed into it

I need to know that what is the state or property of text-area in the flex when we could not enter the text in it, my concern is that whether the text has entered(may after it deleted) or not.
(I think i try my best to explain my problem)
Thanks
Thanks of all of you that you provide the solution/answer
Both MX and Spark TextAreas supports editable and selectable properties. The first one prevent user to change text, the second - to select it:
<mx:TextArea editable="false" selectable="false"
text="Sample Text"/>
<s:TextArea editable="false" selectable="false"
text="Sample Text"/>
I am not sure if I understand your problem, but it sounds like it could be the Safari 5.1 / Flash Debug player bug. Try switching to another browser when debugging/testing your project. If you get the same behaviour, forget everything I just said.
Read more here:
https://discussions.apple.com/message/15666579#15666579
"I also don't think this was intentional at all.  I think it was just a bit careless (Apple pushing out Safari 5.1 before it being thoroughly tested - the flash problem is only one of several issues I've noted with the new browser.  Very dissapointing.)."
If you're talking about MX TextArea you can disable component:
myTextArea.enabled = false;
If you're using Spark TextArea you can use editable property.

How to set the a background image of a RichTextEditor in Flex 4

I have tried setting the background image this way, but it doesn't work. Any ideas how to set the background image of a rich text control in flex as easy as possible? Thanks
.rte{
...
backgroundImage: "assets/globe.jpg";
}
and
<mx:RichTextEditor id="rt"
...
styleName="rte"
/>
Unfortunately, you can't.
The docs for RichTextEditor show that it doesn't support a backgroundImage property, and the component is not skinnable.
Therefore, I'd suggest creating your own wrapper component, which accepts an image, like so:
<!-- Note: Using Canvas becuase your post indicates Flex 3, if using Flex 4, please use Group -->
<Canvas>
<mx:Image width="100%" height="100%" />
<RichTextEditor />
</Canvas>
The RichTextEditor component doesn't support background images last I checked. What you'd want to do is create a custom RTE skin where you add an image behind the actual text, then within the skin, have the do getStyle('backgroundImage') and set it in a bindable private var which is then binded to the image.
That's about it. It's either use this skin or you can always wrap your RTE within a BitmapImage or some other kind of component that supports background images.
EDIT: Sorry, didn't see that this was Flex3. In that case, you'll need to extend your RTE component and add the Image component manually by overriding the createChildren function and then changing the value of the image by overriding the updateDisplayList function using the same getStyle function as mentioned above.
It can be done by setting RTE TextArea's backgroundAlpha to 0
<mx:RichTextEditor id="richTextEditor"
backgroundImage="#Embed('<imagepath>')" width="100%" height="100%"
initialize="{richTextEditor.textArea.setStyle('backgroundAlpha', '0') }"
/>
Note:Please modify image path and you can also set style through CSS/Style tag
Hopefully this will helps

How to set link colors in a RichEditableText component

I've got some text that includes links that I display in a RichEditableText component. How do I change the color of the links from the default blue? I tried the example posted by Peter deHaan but it doesn't work with SDK 4.1. I found a way to do this in MXML, but the text needs to be localizable which means I load it at runtime based on the locale, so I can't just include it inline with the MXML.
To recap: How do I set the link colors for a RichEditableText component that displays HTML that gets loaded at runtime?
Thanks in advance.
Found a way to do this globally, it was in another example on Peter deHaan's site:
http://blog.flexexamples.com/2009/03/17/globally-styling-anchor-tags-on-a-textview-control-in-flex-gumbo/
It's unfortunate you can't set these sorts of things with CSS...
You can also use a nested span tag to colorize your links as you prefer:
<s:RichEditableText id="titleText"
width="100%"
editable="false"
selectable="false"
focusEnabled="false">
<s:textFlow>
<s:TextFlow>
<s:a click="titleText_clickHandler(event)">
<s:span color="#FF0000">
Link's text here
</s:span>
</s:a>
</s:TextFlow>
</s:textFlow>
</s:RichEditableText>

Resources