On Fri, May 13, 2011 at 06:55, Marco Pompili <[email protected]> wrote:

> And i want to set the forms fields "dynamically" instead of doing like
> this:
>
> if(content.sitename) model.setSitename(content.sitename);
> if(content.footer) model.setFooter(content.footer);
> if(content.credits) model.setCredits(content.credits);
> if(content.keywords) model.setKeywords(content.keywords);
> if(content.description) model.setDescription(content.description);
> if(content.analytics) model.setAnalytics(content.analytics);
>
> Using like a loop where i check the keys of both models and assign and add
> the value only if it is not null.
>

for (var fieldName in content)
{
  if (content[fieldName])
  {
    content.set(fieldName, content[fieldName]);
  }
}

Derrell
------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to