The best place to *find* answers to programming/development questions, imo, however it's the *worst* place to *ask* questions (if your first question/comment doesn't get any up-rating/response, then u can't ask anymore questions--ridiculously unrealistic), but again, a great reference for *finding* answers.

My Music (Nickleus)

20111128

richfaces rich hotkey backspace navigation disabling not working with oncomplete [SOLVED]

in my post richfaces rich hotkey backspace navigation disabling not working [SOLVED] i showed how to get the rich hotkey working by changing oncomplete to onclick, but what if you need oncomplete?

the hack i found to work was to set the focus to somewhere in the panel after the a4j:commandLink link was clicked.



<a4j:commandLink
value="#{detail.action}"
id="editlink"
ajaxSingle="true"
action="#{myBean.myAction}"
reRender="detailsPanel"
rendered="#{detail.actionEdit and myBean.isBuyer}"
oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('detailsPanel')}.show();#{rich:element('CDD_quatityInput')}.focus();">
<f:setPropertyActionListener
value="#{detail}"
target="#{myBean.currentDtlItem}" />
<f:setPropertyActionListener
value="#{row}"
target="#{myBean.currentRow}" />
</a4j:commandLink>
CDD_quatityInput is the id of an element in the panel i am showing when the link is clicked.

i saw an example today where the author also put "event.stopPropagation(); event.preventDefault();" into the handler attribute, but i havent seen the need for it yet.

20111124

richfaces rich hotkey backspace navigation disabling not working [SOLVED]



i was debugging a page where i used a rich hotkey tag to disable backspace from navigating backwards in the browser history, using this code:
<!-- disable backspace navigation in e.g. IE -->
<rich:hotKey key="backspace" handler="return false;" disableInInput="true" />

but every time i clicked on this link to show a panel, then pushed backspace (all on the same page of code as the rich hotkey tag), backspace would still navigate backwards as long as i didnt click on the new panel (set focus on the new panel). i figured out that the problem was the use of oncomplete (not my code):
<a4j:commandLink ajaxSingle="true" id="editlink" oncomplete="#{rich:component('editPanel')}.show()">

so i changed it to onclick and then it worked! =)

<a4j:commandLink ajaxSingle="true" id="editlink" onclick="#{rich:component('editPanel')}.show()">

if you still need to use oncomplete instead of onclick, then see my article richfaces rich hotkey backspace navigation disabling not working with oncomplete [SOLVED]

20111115

ubuntu 11.10 unity turns grey and touchpad mouse stops working/freezes [SOLVED]


all of the sudden, mid session, my interface went grey and the theme vanished so everything looked like an old theme and the mousepad mouse cursor wouldnt move, but i could still type and use the keyboard. to fix this i opened a terminal and ran these commands:
sudo modprobe -r psmouse
sudo modprobe psmouse

source: http://ubuntuforums.org/archive/index.php/t-77612.html

20111108

f:loadBundle not working in jboss 7, can't see properties label text [SOLVED]

i made a simple jsf page to test using a properties file labels_no.properties.
here was the code i had:

<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
template="/WEB-INF/templates/default.xhtml">
<f:loadBundle basename="com.mycompany.labels_no" var="label"/>
<ui:define name="content">
<h:form id="reg">
           <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{label.userFirstName}" for="userFirstName" />
...
 and in the eclipes preview window i could see the label and it's value, but in a browser the label was missing. i figured out that the f:loadBundle tag was just in the wrong place, so i moved it inside the ui:define tag (the next line under it) and the label appeared! =)

see also:
http://download.oracle.com/javaee/5/javaserverfaces/1.2/docs/tlddocs/f/loadBundle.html
http://www.roseindia.net/jsf/jsf1.2/jsf-properties.shtml

20111102

jboss quickstarts kitchensink arquillian junit remote test not working [SOLVED]

i ran the managed test and it worked, but when i tried the remote test i got this error:
java.lang.IllegalStateException: Cannot obtain MBeanServerConnection to: service:jmx:rmi:///jndi/rmi://127.0.0.1:1090/jmxrmi
the reason is that i needed to start the local server first, THEN run the unit test.

ref: http://stackoverflow.com/questions/7341308/cannot-run-arquillian-tests/7718339#7718339

ubuntu 11.10 unity left side bar gone [SOLVED]

i upgraded to ubuntu 11.10 a while ago instead of a fresh clean install and then i (regretfully) changed some settings and then the left bar in unity disappeared. to get it back i had to do the following:
* in a terminal run:
ccsm
* search for unity
* enable Ubuntu Unity Plugin
* choose Ignore Conflicts (if you're asked about it)