I am trying to auto select the first item in the search results of a search form created in Forms Builder.
I have extended SearchViewComponent and tried to override a method that is called after the form is completed.
I tried to override "onrRenderEnd" event handler but it is not called. If it were, I was trying to locate the first row of the datagrid and then send a click or select event to simulate the user selecting the 1st row.
Not really sure I am on the right track. Any help would be appreciated.
public void onRenderEnd ()
{
System.out.println( "++++++++++++++++++++ In onRenderedEnd - Control Name = " + m_listViewControl.getName() );
Datagrid datagrid1 = (Datagrid)getControl((new StringBuilder()).append(m_listViewControl.getName()).append("_").append("datagrid").toString(), com.documentum.web.form.control.databound.Datagrid.class);
Iterator itr = datagrid1.getContainedControls();
List<DatagridRow> dgRow = datagrid1.getDatagridRows();
if( !dgRow.isEmpty() )
{
DatagridRow dg1 = (DatagridRow)dgRow.get(0);
dg1.fireEvent( "select" );
System.out.println( "++++++++++++++++++++ In onControlInitialized - fired event" );
}
else
{
System.out.println( "++++++++++++++++++++ In onControlInitialized - dbRow was empty ..." );
}
super.onRenderEnd();
}
Thanks in advanced,
Deron