Silverlight: Uncached Children elemetn getting cached by SL runtime - silverlight-4.0

Silverlight: I have a parent cached Canvas element having uncached children element having opacity animation.
The silverlight runtime automaticaly makes these children elements cached.
How can I explicitly stop these childrent elements getting cached by SL runtime

Please try set CacheMode="{x:Null}" in your child elements.

Related

VueJS - Get child width using $refs

I'm trying to extract the clientWidth of a child component inside VueJS. I'm calling $refs inside mounted, and assign its value to some data:
this.width = this.$refs.refName.clientWidth
The issue is that the width of this component is defined as 100% the one of its parent. But according to Vue lifecycle, the child DOM will be mounted before its parent. That causes the width in the child to always be 0 at mounted, because its parent isn't rendered yet.
My only solution would be to hardcode values in CSS, but I'd like to avoid that. What is the best way to achieve the desired effect?
Try using $nextTick():
this.$nextTick(
() => { this.width = this.$refs.refName.clientWidth); }
);
This will run after finishing all of the pending Vue work and browser updates. So, it should catch the element at that point.
If that still doesn't work (for various reasons it can be delayed beyond that point at times), you are usually stuck with a window.setTimeout() call with a kludgy delay value in it.
What is a little better in that case but more work is a window.setInterval() hander that loops waiting for the element to finally be drawn and gain a width.
One thing you cannot do is bind to that value and expect it to work. $refs is not reactive nor are any of a DOM's element attributes.

stale element reference error after self.driver.back()?

I'm getting Selenium exception stale element reference: element is not attached to the page document after the first iteration of the for loop. My code is :
for gc in grpCommune:
self.driver.execute_script("return arguments[0].scrollIntoView(true);", gc)
self.driver.execute_script("window.scrollTo(0, 0);")
e=gc.find_element_by_xpath('//a[2]')
e.click()
sleep(1)
...
genertaeCSV()
self.driver.back()
how can I resolve it?
Stale Element exception occurs when the selenium reference bound to the element is no more valid, generally, this happens when you either navigate away from the page or refresh the page or the contents on the page is reloaded. In your case, you are trying to refer to the gc element which was captured with a reference before clicking the e element. The moment you clicked on e element using e.click() button, all the references in grpCommune is no longer valid. So, you will be able to run only the first iteration successfully with your code.
How do I fix this code:
Get the gc element within the for loop. Rather than using for each use for loop with the index.
Stale element exception occuring when element in on page but selenium driver instance could not interect with that element.
Following actions can be resolve stale element exception
1.Refresh page by using "navigate(). refresh()" method in selenium
2.using loop try to click or check visible of that element if that element visible or already clicked exit from loop.

DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node

I am having an issue with a third party library.
I wrote a component to watch the position property and call the reload method to refresh the overlays on the map.
It performed normal when there is only one v-for.
But failed when there is two v-for.
How do I fix this?
Just wrap every v-for directive in it's own, dedicated parent div.
Each v-for directive expands into multiple elements. If there are multiple lists with the same parent element which need to be updated at the same time, Vue is having a hard time updating the virtual dom.
This issue does not only happen with multiple v-fors in one component; I also came across it when using multiple root elements in nuxt3. I fixed the issue by using old-style vue2 syntax: Every template contains only one child element (or v-for-directive), which contains all the content.
TL;DR: Wrapping complex contents (v-for, content of a page > 1 element, ...) in another surrounding div might solve the issue.

Selenium webElement equals: does it compare the state of the element?

how does equals work on webElement, can I use it to check if the same element has been completely loaded?
For elements with animation, would equals return true imply the element returned by findElement at different time stamp are identical in look?
Say
webElemenet ele1 = driver.findElement(By.class("loading"));
sleep(10);
webElemenet ele2 = driver.findElement(By.class("loading"));
Would ele1.equals(ele2) == true, imply the element is completely loaded?
The equal method indicates if two web elements are referring to the same instance of an HTML element in the page.
Whether the content of the HTML elements are different or not has no impact.
So no you can't use it to check the state of an element.
To check the state of an element, you'll have to read the attributes/properties or the text content.
The fact that the element returned is not null indicates that the element exists in the DOM (document object model). Loading of the element would be complete, however there can sometimes be another hidden web element deliberately blocking access to the element until the page has completely loaded or ajax controls are finished processing. For that, you'd need to check its clickable status through a fluent wait command.

Is calling doLayout() method a must after adding child to a parent?

In our application, there is a tabpanel in which we are adding/removing the panel dynamically.
The panels get added at the click of a menu item by the following code in menu handler:
Ext.getCmp('mainTabPanelId').add(getPanel());
Here getPanel() method returns the panel after creating it.
Assuming that the id of main tab panel is mainTabPanelId and that of the child panel is panelId, in this context, could someone guide at the following:
Is it necessary to call doLayout() on mainTabPanel after the add method?
Should the doLayout() be called on the mainTabPanel or on the newly added child panel, that is, Ext.getCmp('mainTabId').doLayout() or Ext.getCmp('panelId').doLayout()?
Will a call to doLayout() take care of all the issues related to rendering, like scrollbars esp.?
The method getPanel() should return an already created panel (using Ext.create) or should it return a config object (having xtype:'panel')? Which one should be preferred for better performance keeping time in mind?
AbstractContainer::add()
<...> If the Container was configured with a size-managing layout manager, the Container will recalculate its internal layout at this time too.
So you don't have to do 1 — 3 because:
AbstractContainer::doLayout()
<...> The framework uses this internally to refresh layouts form most cases.
AbstractContainer::defaults
For defaults to work, the child items must be added using {xtype: ......} NOT using Ext.create("widget.type",{}) © roger.spall
So I'd prefer return configuration object instead of components itself.