0 Replies Latest reply on Oct 31, 2011 8:08 PM by KGBMICHEL

    Problems with datagrid from FXP, I did something, but I got problems with mysql...

    KGBMICHEL

      Good night My name is Michel.

      Right!, I have a challenge to myself. that is to relearn flash builder, I have a few years without touching it or anything.

      But I still have the ease of get these new things added.

      Going straight to the point, as I am Brazilian, some things from the file will be in Portuguese, I hope you can help me! I appreciate it. Well, I'm creating a Datagrid, this Datagrid was done in FXP, and imported into the FB, I did some workarounds and got where I wanted, only that there are problems.

      the scheme is this:

      MySQL database = NoticiasService

      Connected by Zend / PHP.

      Everything right until here.

      I have the file main.mxml> DatalistSinspebNoticias.mxml> DatalistSinspebNoticiasRepeatedItemSkin.mxml - just here.

      I will not make a closed file (FXP), because my file is just a mess and only I understand the way it was organized.

       

      The problem is:

      The datagrid is infinite, I want to limit it to eight items repeated.

      The link does not work with "TextConverter" to "HTML"

      FB lives showing me glitches.

       

      then I will initiate an implementation of other applications, such as adding data to the DB, and Update DB. Thanks Folks!

       

       

      Main.mxml ------------------------------------------------------------------------->

       

      <?xml version='1.0' encoding='UTF-8'?>

      <s:Application xmlns:ATE="http://ns.adobe.com/ate/2009"

                                       xmlns:ai="http://ns.adobe.com/ai/2009"

                                       xmlns:fc="http://ns.adobe.com/flashcatalyst/2009"

                                       xmlns:d="http://ns.adobe.com/fxg/2008/dt"

                                       xmlns:fx="http://ns.adobe.com/mxml/2009"

                                       xmlns:s="library://ns.adobe.com/flex/spark"

                                       xmlns:lib="assets.graphics.caixa_feed_sinspeb.*"

                                       xmlns:flm="http://ns.adobe.com/flame/2008"

                                       xmlns:noticiasservice="services.noticiasservice.*"

                                       width="100%" height="100%" backgroundColor="#FFFFFF" preloaderChromeColor="#FFFFFF"

                                       fc:previewHeight="380" fc:previewWidth="430">

                <fx:Style source="Main.css"/>

                <fx:Script>

                          <![CDATA[

                                    import mx.events.FlexEvent;

       

       

                                    protected function list1_creationCompleteHandler(event:FlexEvent):void

                                    {

                                              getAllNoticiasResult.token = noticiasService.getAllNoticias();

                                    }

       

                          ]]>

       

       

                </fx:Script>

                <fx:Declarations>

                          <s:CallResponder id="getAllNoticiasResult"/>

                          <noticiasservice:NoticiasService id="noticiasService" showBusyCursor="true"/>

                </fx:Declarations>

                <fx:DesignLayer d:id="2" d:userLabel="Layer 1">

                          <s:List id="list1" x="10" y="8"

                                              creationComplete="list1_creationCompleteHandler(event)"

                                              skinClass="components.DataListSinspebNoticias" labelField="conteudo_nt">

                                    <s:AsyncListView list="{getAllNoticiasResult.lastResult}"/>

                          </s:List>

                </fx:DesignLayer>

      </s:Application>

      ------------------------------------------------------------------------->

       

      DatalistSinspebNoticias.mxml ------------------------------------------------------------------------->

       

      <?xml version="1.0" encoding="utf-8"?>

      <s:Skin xmlns:s="library://ns.adobe.com/flex/spark"

                          xmlns:fx="http://ns.adobe.com/mxml/2009"

                          xmlns:d="http://ns.adobe.com/fxg/2008/dt"

                          xmlns:flm="http://ns.adobe.com/flame/2008"

                          xmlns:ai="http://ns.adobe.com/ai/2009"

                          width="407" height="374">

                <fx:Metadata>[HostComponent("spark.components.List")]</fx:Metadata>

                <s:states>

                          <s:State name="normal"/>

                          <s:State name="disabled"/>

                </s:states>

                <s:DataGroup id="dataGroup" x="0" y="0" width="407" height="353" clipAndEnableScrolling="true"

                                               itemRenderer="components.DataListSinspebNoticiasRepeatedItemSkin"

                                               height.normal="374" buttonMode.normal="true">

                          <s:layout>

                                    <s:VerticalLayout gap="1"/>

                          </s:layout>

                </s:DataGroup>

      </s:Skin>

      ------------------------------------------------------------------------->

       

      DatalistSinspebNoticiasRepeatedItemSkin.mxml ------------------------------------------------------------------------->

       

      <?xml version="1.0" encoding="utf-8"?>

      <s:ItemRenderer xmlns:s="library://ns.adobe.com/flex/spark"

                                              xmlns:fx="http://ns.adobe.com/mxml/2009"

                                              xmlns:d="http://ns.adobe.com/fxg/2008/dt"

                                              xmlns:flm="http://ns.adobe.com/flame/2008"

                                              xmlns:ai="http://ns.adobe.com/ai/2009"

                                              width="402" height="39" autoDrawBackground="false">

                <fx:Script>

                          <![CDATA[

                                    import flashx.textLayout.conversion.ConversionType;

                                    import flashx.textLayout.conversion.TextConverter;

                          ]]>

                </fx:Script>

                <s:states>

                          <s:State name="normal"/>

                          <s:State name="hovered"/>

                          <s:State name="selected"/>

                </s:states>

                <s:Rect x="5" y="3" width="78" height="32">

                          <s:fill>

                                    <s:SolidColor color="#01557C"/>

                          </s:fill>

                          <s:stroke.hovered>

                                    <s:SolidColorStroke caps="none" color="#96F2FF" joints="miter" miterLimit="4" weight="2"/>

                          </s:stroke.hovered>

                </s:Rect>

                <s:Rect d:id="3" x="85.5" y="0.5" width="315" height="37" flm:variant="1"

                                    x.hovered="86" y.hovered="1">

                          <s:fill>

                                    <s:LinearGradient x="157.5" y="0" scaleX="32" rotation="90">

                                              <s:GradientEntry ratio="0" color="#FFFFFF"/>

                                              <s:GradientEntry ratio="0.488676" color="#E0EEF9"/>

                                              <s:GradientEntry ratio="1" color="#D6E9F7"/>

                                    </s:LinearGradient>

                          </s:fill>

                          <s:stroke>

                                    <s:SolidColorStroke caps="none" color="#666666" joints="miter" miterLimit="4" weight="1"

                                                                                      color.hovered="#999999" weight.hovered="2"

                                                                                      color.selected="#0065FF"/>

                          </s:stroke>

                </s:Rect>

                <s:Rect d:userLabel="Item Highlight Rectangle" x="5" y="0" width="396" height="33" alpha="0">

                          <s:fill>

                                    <s:SolidColor color="0xCED7EE"/>

                          </s:fill>

                </s:Rect>

                <s:RichText  x="20" y="12" width="48" height="14" ai:aa="2"

                                              color="#FFFFFF" columnCount="1" fontFamily="Myriad Pro" fontSize="14" kerning="on"

                                              tabStops="S0" text="{data.datada_nt}" flm:variant="2" whiteSpaceCollapse="preserve"/>

                <s:RichText x="89.95" y="8" width="309" height="24" ai:aa="2" color="#000000" columnCount="1"

                                              fontFamily="Arial Narrow" fontSize="11" kerning="on"

                                              tabStops="S0 S50 S100 S150 S200 S250 S300"

                                              textFlow="{TextConverter.importToFlow(data.conteudo_nt, TextConverter.TEXT_FIELD_HTML_FORMAT)}"

                                              trackingRight="16%"

                                              flm:variant="3" whiteSpaceCollapse="preserve"

                                              buttonMode.normal="false" lineThrough.normal="false">

                          <s:filters>

                                    <s:GlowFilter alpha="1.0" blurX="0" blurY="0" color="#000000" inner="false"

                                                                    knockout="false" quality="2" strength="1"/>

                          </s:filters>

                </s:RichText>

                <s:Path includeIn="hovered" x="0.35" y="12.35" data="M 12.40 7.15 L 0.03 14.29 0.03 0.01 Z ">

                          <s:stroke>

                                    <s:SolidColorStroke caps="none" color="#666666" joints="miter" miterLimit="4" weight="1"/>

                          </s:stroke>

                          <s:fill>

                                    <s:LinearGradient rotation="90">

                                              <s:GradientEntry color="#FFFFFF" ratio="0"/>

                                              <s:GradientEntry color="#E0EEF9" ratio="0.488676"/>

                                              <s:GradientEntry color="#D6E9F7" ratio="1"/>

                                    </s:LinearGradient>

                          </s:fill>

                </s:Path>

      </s:ItemRenderer>

       

      ------------------------------------------------------------------------->