On 9/21/06, Gerald Müllan <[EMAIL PROTECTED]> wrote:
I have declared this as a SelectItem, any reason why that should not work?
Yes, I figured that, when one wasn't working I tried the other and forgot to change it back. I have changed it back to
use getValue instead of getLabel.
Still getting the null pointer exception in the getPagetoDisplay method :(
Thanks for trying to help.You don`t need the immediate attribute in this simple usecase.
Removed that. Changed the JSP selectOneMenu to the following:
<h:selectOneMenu value="1">
Also tried with:
<h:selectOneMenu value=" tableform.selectedTable">
Modified the getSelectedItem to as follows:
public SelectItem getSelectedTable() {
selectedTable = new SelectItem("1", "Table 1");
return selectedTable;
}
<h:selectOneMenu value="1">
Also tried with:
<h:selectOneMenu value=" tableform.selectedTable">
Modified the getSelectedItem to as follows:
public SelectItem getSelectedTable() {
selectedTable = new SelectItem("1", "Table 1");
return selectedTable;
}
Just
declare the value attribute of the selectOneMenu in the bean and give
it the type corresponding to the "value"
type of the SelectItem. In your case is this a String.
private String selectedTable = null;
I have declared this as a SelectItem, any reason why that should not work?
You have also permuted the "label" and the "value" attribute when
creating the SelectItem.
The fist argument is the value (hidden on the page, this is the value
which is set to the value of the selectOneMenu) and the second one the
label (can be seen in the drop down). And in your getPagetoDisplay() method, place the condition of which
value the selectedTable is.
Yes, I figured that, when one wasn't working I tried the other and forgot to change it back. I have changed it back to
Any further help needed?
Still getting the null pointer exception in the getPagetoDisplay method :(
Regards,
Aneesha

