i happen to have lenses that include SELECT and OPTION elements (one of my views gives an editable form that can be submitted to a server-side database). but it appears that my browser (Firefox 2.0.0.8) is stripping out all non-OPTION elements from inside the SELECT, before exhibit can inspect the dom. this means that my DIVs with special exhibit attributes don't get interpreted by the template instantiator.
my solution, just in case anybody is interested, was to create a new exhibit attribute called "ex:convert-tag" whose value is used to replace the tag on the element being generated. so instead of saying <select>, i say <div ex:convert-tag="select">. the patch (two lines of code) is below. a remaining problem is that the select widget gets rendered "out of sync": dom inspection shows that the correct OPTION element has a "selected" attribute, but the control is actually selecting the first option (which seems to be the default). i guess i'll have to write some javascript to fix it up after generation (probably using the recently-added post-generation hook). anyway, thanks for all this software that is written so well that it can actually be read! (i was even able to get exhibit to load data remotely with a sparql query that's embedded in the page, just using the exposed api and a little helper code.) daniel ----- the diff below is against this version: [ URL: http://simile.mit.edu/repository/exhibit/branches/2.0/src/webapp/api/scripts/ui/lens.js Revision: 8555 ] [ --- old-exhibit/src/webapp/api/scripts/ui/lens.js 2007-11-05 17:50:10.000000000 -0800 +++ new-exhibit/src/webapp/api/scripts/ui/lens.js 2007-11-05 17:50:10.000000000 -0800 @@ -293,6 +293,8 @@ templateNode.control = value; } else if (name == "content") { templateNode.content = Exhibit.ExpressionParser.parse(value); + } else if (name == "convert-tag") { + templateNode.tag = value; } else if (name == "if-exists") { templateNode.condition = { test: "if-exists", ] _______________________________________________ General mailing list [email protected] http://simile.mit.edu/mailman/listinfo/general
