You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Oleg Konovalov <ol...@gmail.com> on 2013/07/05 00:24:08 UTC

Building Spark Datagrid dynamically

Hi,

I am getting data from the database via XML (SOAP Web Service),
and in that case I don't know number of columns or their names.
Need to display them in Spark DataGrid (and allow user to add, edit, delete
rows).

The complication I see here is that in that project there is Parsley +
proprietary corporate
Flex/Java soap framework, so I normally know a Value Object and get a
Vector of rows, converting it into a ResultSet to process.

in Parsley Command:
public function result(event:ResultEvent) {
  var rs:Vector.<Object> = ServiceUtils.extractResultSet(event.result,
ValueObject);
...
}

But in that case there is no static Value Object.

Is there a way to create dynamic Value Objects?


Can you tell me how can I retrieve Columns (metadata) from XML (length and
Column Names) ?

Please help!

TIA,
-- 
Thank you,
Oleg.

Re: Building Spark Datagrid dynamically

Posted by Oleg Konovalov <ol...@gmail.com>.
I will try that.

I also need to be able to edit data with unknown number and names of
columns on Flex4 Form.
Any idea how to do it? Code sample?

TIA,
Oleg
On Jul 4, 2013 6:33 PM, "OmPrakash Muppirala" <bi...@gmail.com> wrote:

> (Please use dev@flex.apache.org for posting on this list)
>
> Spark DataGrid has support to automatically add the column based on the
> given dataProvider.  You can declare a Spark DataGrid and just give it a
> dataprovider.  The columns should appear automatically.
>
> As for the column lengths, you could specify it via the typicalItem
> property.
>
> Ex.:
> <s:DataGrid dataProvider={_dp}>
> <s:typicalItem >
>  <s:DataItem field1="xxxxxxxx" field2="xxxxx" field3="xxx"
> field4="xxxxxxxxxxxxxxxxxxxxxxxx" />
> </s:typicalItem>
> </s:DataGrid>
>
> If this does not work for you, please give us a sample of your XML, code
> snippet, etc.
>
> Thanks,
> Om
>
> On Thu, Jul 4, 2013 at 3:24 PM, Oleg Konovalov <ol...@gmail.com> wrote:
>
> > Hi,
> >
> > I am getting data from the database via XML (SOAP Web Service),
> > and in that case I don't know number of columns or their names.
> > Need to display them in Spark DataGrid (and allow user to add, edit,
> delete
> > rows).
> >
> > The complication I see here is that in that project there is Parsley +
> > proprietary corporate
> > Flex/Java soap framework, so I normally know a Value Object and get a
> > Vector of rows, converting it into a ResultSet to process.
> >
> > in Parsley Command:
> > public function result(event:ResultEvent) {
> >   var rs:Vector.<Object> = ServiceUtils.extractResultSet(event.result,
> > ValueObject);
> > ...
> > }
> >
> > But in that case there is no static Value Object.
> >
> > Is there a way to create dynamic Value Objects?
> >
> >
> > Can you tell me how can I retrieve Columns (metadata) from XML (length
> and
> > Column Names) ?
> >
> > Please help!
> >
> > TIA,
> > --
> > Thank you,
> > Oleg.
> >
>

Re: Building Spark Datagrid dynamically

Posted by OmPrakash Muppirala <bi...@gmail.com>.
(Please use dev@flex.apache.org for posting on this list)

Spark DataGrid has support to automatically add the column based on the
given dataProvider.  You can declare a Spark DataGrid and just give it a
dataprovider.  The columns should appear automatically.

As for the column lengths, you could specify it via the typicalItem
property.

Ex.:
<s:DataGrid dataProvider={_dp}>
<s:typicalItem >
 <s:DataItem field1="xxxxxxxx" field2="xxxxx" field3="xxx"
field4="xxxxxxxxxxxxxxxxxxxxxxxx" />
</s:typicalItem>
</s:DataGrid>

If this does not work for you, please give us a sample of your XML, code
snippet, etc.

Thanks,
Om

On Thu, Jul 4, 2013 at 3:24 PM, Oleg Konovalov <ol...@gmail.com> wrote:

> Hi,
>
> I am getting data from the database via XML (SOAP Web Service),
> and in that case I don't know number of columns or their names.
> Need to display them in Spark DataGrid (and allow user to add, edit, delete
> rows).
>
> The complication I see here is that in that project there is Parsley +
> proprietary corporate
> Flex/Java soap framework, so I normally know a Value Object and get a
> Vector of rows, converting it into a ResultSet to process.
>
> in Parsley Command:
> public function result(event:ResultEvent) {
>   var rs:Vector.<Object> = ServiceUtils.extractResultSet(event.result,
> ValueObject);
> ...
> }
>
> But in that case there is no static Value Object.
>
> Is there a way to create dynamic Value Objects?
>
>
> Can you tell me how can I retrieve Columns (metadata) from XML (length and
> Column Names) ?
>
> Please help!
>
> TIA,
> --
> Thank you,
> Oleg.
>