[Laszlo-dev] For Review: Change 20071106-bargull-8 Summary: Find source of basedatacombobox-based components

André Bargull a.bargull at intensis.de
Wed Nov 7 14:00:58 PST 2007


[The same approach is used in basegrid, I just copied it from there.]

"itemdatapath" is always an absolute xpath which should give you a set 
nodes from which to build up the items for the "basedatacombobox".
So, because "itemdatapath" an absolute xpath, we can "easily" determine 
the dataset for this xpath, then install an "ondata"-handler and so on...

Do we have got a more OL-"native" way to handle this?
A possible way would be using some kind of datapointer [just like Josh 
did it initially], which does allow you to point to more than one xml-node.
But currently, you'll get a warning if a datapointer points to multiple 
xml-nodes ("datapointer matched n nodes"). [This is why Josh tried to 
add this xpath "position" predicate: "[1]".]

Clumsy? Maybe, maybe not...

On 11/7/2007 1:51 PM, P T Withington wrote:
> Is there any better way of deciding when a datapath is immediate?  
> Other than searching it for ':/'?  Oh, I see, these are not datapaths, 
> they are datapath specifications?  This stuff makes my head hurt...
>
> On 2007-11-06, at 18:31 EST, André Bargull wrote:
>
>> [Note: Modified changeset of "20071105-jcrowley-a"]
>>
>> Change 20071106-bargull-8 by bargull at dell--p4--2-53 on 2007-11-06 
>> 21:06:22
>> in /home/Admin/src/svn/openlaszlo/trunk
>> for http://svn.openlaszlo.org/openlaszlo/trunk
>>
>> Summary: Find source of basedatacombobox-based components
>> with selectfirst="false" emits Debugger warnings
>>
>> New Features:
>>
>> Bugs Fixed:
>> LPP-4704 : Find source of basedatacombobox-based
>> components with selectfirst="false" emits Debugger
>> warnings
>>
>> Technical Reviewer: jcrowley
>> QA Reviewer: max
>> Doc Reviewer: (pending)
>>
>> Documentation:
>>
>> Release Notes:
>>
>> Details:
>> Josh said: This is a workaround for an issue involving xpathQuery() 
>> calls from an oninit handler. Basedatacombobox kept getting "p is 
>> null" warnings because it was requesting data before the data was 
>> actually there, and because it doesn't itself have a datapath, but 
>> rather string attributes like "itemdatapath" that it uses in 
>> xpathQuery() calls, I couldn't just move things from oninit to ondata.
>> ---
>> Workaround: Check for data by querying the itemdatapath and if we 
>> don't get any results, install a delegate to listen for the 
>> "ondata"-event of the dataset.
>> ---
>> Josh said: The "p is null" errors are expected in situations where 
>> calls like this are made, but we shouldn't be generating them from 
>> our own base components.
>>
>> Other changes:
>> Check for valid datapointer in "_updateSelectionByIndex",
>> + nullpointer-check in the same method
>> Removed a nondescriptive comment and an unnecessary debug-output.
>>
>>
>> Tests:
>> The example attached to the bug. Notice there are no "p is null" 
>> warnings. (You can compare with an unmodified branch, if you'd like.)
>>
>> Also, run: test/components/base/lzunit-basedatacombobox.lzx
>> It operates as before, minus the "p is null" warnings.
>>
>> Files:
>> M lps/components/base/basedatacombobox.lzx
>>
>> Changeset: 
>> http://svn.openlaszlo.org/openlaszlo/patches/20071106-bargull-8.tar
>
>


More information about the Laszlo-dev mailing list