Monday, February 27, 2006

Datasets are not allowed an id

I just tried to create a Laszlo dataset like this:

<dataset id="mydata"/>

and I got this compiler error:

"required attributes missing name is a required attribute of dataset; compilation aborted"

It appears that a dataset is not allowed the "id" attribute. But the compiler error is misleading; the "name" attribute is not required. You can in fact do this: <dataset />. That is discussed in the section on databinding of the Guide: "Datasets will automatically name themselves localdata if a name is not specified."

So there is at least one answer to my question "why not always use the id attribute instead of the name attribute?" There are cases where id is simply not allowed and you must use name as an identifier.

0 Comments:

Post a Comment

<< Home