In which radio button event should I put this ? I tried it on "onChange" and "onClick". didn't work.
Matara
Main Topics
Browse All TopicsI'm using Sun Java Studio Creator 2 Update 1 in my project. I use the datatable component (bound to database table) and need to provide the single row selection facility. I used radiobuttons in one column to enable this. The creator had inserted the following javascript in the ui:table tag.
function initAllRows() {
var table = document.getElementById("f
table.initAllRows();
}
Then I inserted the attached code snippet in my bean class.
When I run the the application the radio selection works (I can select a single radio button). But it doesn't highlight the selected row and it also gives the following error message.
Error Message:
Line: 111
Char: 3
Error: 'null' is null or not an object
URL: http://localhost:29080/sps
I can't find what the problem is.
Can anyone help me please?
Than You
Matara
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
thanks for your reply.
I checked in both "Sun Java Studio Creator 2 Update 1" and "netbeans 6". But it doesn't show "event change listener" when rightclick on radiobutton. i've attched a screenshot. I'm using "Sun Java Studio Creator 2 Update 1" in my project. I'm using 2 datatables in the page.
Thanks
Matara
Hi,
I tried it. But it didn't work.
I think the problem is some where else.
I tried a new page putting two tables in a LayoutPanel. I put the following javascripts in two tables in the JSP (table names "matara" and "suresh").
function initAllRows() {
var table = document.getElementById("f
table.initAllRows();
}
function initAllRows() {
var table = document.getElementById("f
table.initAllRows();
}
Then added,
selected="#{UserManager_1_
onClick="setTimeout('initA
name="radioButton1" selected="#{UserManager_1_
for table matara and
selected="#{UserManager_1_
onClick="setTimeout('initA
name="radioButton2" selected="#{UserManager_1_
for table surash
Then added the following codes in the bean.
private TableSelectPhaseListener tableSelectPhaseListener = new TableSelectPhaseListener()
public void setSelected(Object object) {
// RowKey rowKey = (RowKey)getValue("#{curren
// if (rowKey != null) {
// tableSelectPhaseListener.s
// }
}
public Object getSelected() {
// RowKey rowKey = (RowKey)getValue("#{curren
// return tableSelectPhaseListener.g
return null;
}
public Object getSelectedValue() {
// RowKey rowKey = (RowKey)getValue("#{curren
// return (rowKey != null) ? rowKey.getRowId() : null;
return null;
}
public boolean getSelectedState() {
// RowKey rowKey = (RowKey)getValue("#{curren
// return tableSelectPhaseListener.i
return false;
}
private TableSelectPhaseListener tableSelectPhaseListener1 = new TableSelectPhaseListener()
public void setSelected1(Object object) {
RowKey rowKey = (RowKey)getValue("#{curren
// if (rowKey != null) {
// tableSelectPhaseListener.s
// }
}
public Object getSelected1() {
// RowKey rowKey = (RowKey)getValue("#{curren
// return tableSelectPhaseListener.g
return null;
}
public Object getSelectedValue1() {
// RowKey rowKey = (RowKey)getValue("#{curren
// return (rowKey != null) ? rowKey.getRowId() : null;
return null;
}
public boolean getSelectedState1() {
// RowKey rowKey = (RowKey)getValue("#{curren
// return tableSelectPhaseListener.i
return false;
}
Then It works fine.
Then I opened the comments in first for methods and removed the unnecessary returns (i included when commenting the code).
Then it gives the error
"null" is null or not an object. at the javascript line table.initAllRows();
Then I changed second javascript function name to table.initAllRows1();
Now it works fine. I used a message group to verify that the correct selected row id is returned for each table.
But I'm still not convinced about what's happening.
If possible help me to understand what's happening.
Thank you very much for your help.
Matara
im not sure what exactly is going with ur code
here is a nice blog ,, u can find many things inside it
http://blogs.sun.com/divas
and here is a nice one
http://blogs.sun.com/winst
hope u will find ur solution in one of them,
and keep me updated whit whats happened with u
Business Accounts
Answer for Membership
by: mohammedfPosted on 2008-02-01 at 04:35:34ID: 20796004
on the radio button event type this:
Select allOpen in new window