Thursday, December 19, 2019

redhat 7 laptop getting ERR_NETWORK_CHANGED errors in chrome

For a long time, I've been getting and ignoring errors in Chrome on my centos 7 laptop about "ERR_NETWORK_CHANGED".  This often makes transactions in banking and shopping sites fail completely and causes me to switch to a different machine.  Last week I used the Southwest wifi while traveling, and constantly received messages about network disconnects while using google docs.  I'm hoping the problem is the same, but not sure.  It happens with both wired and wireless network connection.

Anyway, I spent some time investigating today.  I thought it was network disconnects, but after looking at lots of generic network troubleshooting info, I searched for the chrome error and found some interesting hits.

This link suggests that the problem is due to ipv6, and disabling it SEEMS to have also solved my problem though it remains to be seen.  But I did not see any details as to WHY ipv6 is a problem, just that it is.  I'm sure if I looked harder I'd find it.  Here is another link about how to disable ipv6, I disabled all 3 properties that it mentions, but I used "sysctl -w" to change the configuration instead of editing sysctl.conf.  The result should be the same.

I used the "watch" command as suggested in the first link to monitor the output of "ip address" and see that the ipv6 interface was occasionally flapping to "tentative".  I used "sysctl -w" to disable ipv6.  And then I used watch again to confirm that the ipv6 interfaces are gone and that the word tentative is no longer appearing in the "ip address" output.

Here are the commands that I found helpful:
watch -n 2 -b -d 'ip address'
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1
ip address | grep ipv6
watch -d 'ip address | fgrep tentative'
Finally, here is another link for general network troubleshooting that gives some helpful background.

Wednesday, December 18, 2019

wired ethernet adapter on docking station quit working from Dell XPS 15 laptop

One of the joys of using Windows is when things that have been working forever mysteriously quit working.  That was the case with my Dell XPS 15 laptop running Windows 10.  "All of the sudden" the wired ethernet port on the docking station quit working.  There was probably/possibly a Dell/Windows update in the interim that broke it but who knows.  It took me a while to figure out, but to solve the problem I used these instructions for manually fixing the docking station drivers from the dell website (expand the "Installing drivers" node).  I skipped some of the steps, but I updated the bios and thunderbolt controller driver from this link.  I updated the docking station firmware from this link.  At this point I received a message that a new thunderbolt device was detected which made me happy.

I downloaded the realtek USB GBE ethernet controller driver from the drivers page for the laptop, and first used it to remove the existing installation and then ran it again to reinstall.  At this point, I turned off the wireless and confirmed that the wired ethernet port was indeed working correctly.

Monday, December 9, 2019

handling primefaces datatable events

This article is a good tutorial for handling events for the primefaces datatable component,

update tag behavior for components nested in Primefaces dataTable

I discovered the hard way that update="someComponentId" does not work for a commandLink nested inside a datatable. After some searching I found that you must use the syntax 'update=":formId:componentId" to make the update work. E.g., the example below works, but if I change the commandLink update to update="#{viewName}MembersPanel", an error results:

                <p:dataTable id="#{viewName}MemberDataTable"
                             var="member"
                             value="#{wizardController.members}"
                             emptyMessage="No members added.">

                    <p:column headerText="Cable name">
                        <h:outputText value="#{member.name}" />
                    </p:column>

                    <p:column headerText="Action">
                        <p:commandLink  id="#{viewName}RemoveCommandLink"
                                        value="Remove"
                                        action="#{wizardController.removeMember(member)}"
                                        onstart="PF('loadingDialog').show()"
                                        oncomplete="PF('loadingDialog').hide();update#{rootViewId}WizardButtons();"
                                        update="@form:#{viewName}MembersPanel"
                                        process="@form:#{viewName}MembersPanel">
                        </p:commandLink>
                    </p:column>

                </p:dataTable>

determining the events supported by Primefaces components

Apparently like others have experienced, I've found it a bit of a challenge to determine exactly what ajax events are supported by Primefaces components.  There is a helpful stackoverflow thread that I've encountered more than once that gives some useful suggestions, and I wanted to list some of them here in case the thread disappears.

The first place to look, of course, is the Primefaces documentation for your version.  The problem is that not all supported events are listed for all components.  There is some helpful general information about DOM events on w3schools, and jQuery events.

One post suggests looking in the primefaces javascript code:
If you want to find out which events are supported:

If you want to find out which events are supported:
  1. Download and unpack primefaces source jar
  1. Find the JavaScript file, where your component is defined (for example, most form components such as SelectOneMenu are defined in forms.js)
  1. Search for this.cfg.behaviors references
For example, this section is responsible for launching toggleSelect event in SelectCheckboxMenu component:
fireToggleSelectEvent: function(checked) { if(this.cfg.behaviors) { var toggleSelectBehavior = this.cfg.behaviors['toggleSelect']; if(toggleSelectBehavior) { var ext = { params: [{name: this.id + '_checked', value: checked}] } } toggleSelectBehavior.call(this, null, ext); }},


But the most interesting post gives mechanisms for listing the events in xhtml code and in java code.

The xhtml approach:
You can output the list directly in xhtml by binding that component to a request scoped variable and printing the eventNames property:
<p:autoComplete binding="#{ac}"></p:autoComplete><h:outputText value="#{ac.eventNames}" />This outputs
[blur, change, valueChange, click, dblclick, focus, keydown, keypress, keyup, mousedown, mousemove, mouseout, mouseover, mouseup, select, itemSelect, itemUnselect, query, moreText, clear]

The java approach:
Figure out the component implementation class and invoke its' implementation of javax.faces.component.UIComponentBase.getEventNames() method:import javax.faces.component.UIComponentBase; public class SomeTest { public static void main(String[] args) { dumpEvents(new org.primefaces.component.inputtext.InputText()); dumpEvents(new org.primefaces.component.autocomplete.AutoComplete()); dumpEvents(new org.primefaces.component.datatable.DataTable()); } private static void dumpEvents(UIComponentBase comp) { System.out.println( comp + ":\n\tdefaultEvent: " + comp.getDefaultEventName() + ";\n\tEvents: " + comp.getEventNames()); } }This outputs:
org.primefaces.component.inputtext.InputText@239963d8: defaultEvent: valueChange; Events: [blur, change, valueChange, click, dblclick, focus, keydown, keypress, keyup, mousedown, mousemove, mouseout, mouseover, mouseup, select]org.primefaces.component.autocomplete.AutoComplete@72d818d1: defaultEvent: valueChange; Events: [blur, change, valueChange, click, dblclick, focus, keydown, keypress, keyup, mousedown, mousemove, mouseout, mouseover, mouseup, select, itemSelect, itemUnselect, query, moreText, clear]org.primefaces.component.datatable.DataTable@614ddd49: defaultEvent: null; Events: [rowUnselect, colReorder, tap, rowEditInit, toggleSelect, cellEditInit, sort, rowToggle, cellEdit, rowSelectRadio, filter, cellEditCancel, rowSelect, contextMenu, taphold, rowReorder, colResize, rowUnselectCheckbox, rowDblselect, rowEdit, page, rowEditCancel, virtualScroll, rowSelectCheckbox]