Can somebody point me in the right direction with the following?
I have the following scenario: I have a link from Page A to Page B. On page B a
search is performed and the results are presented in a DataView. The user
clicks on a row to select the result and is returned to Page A.
I would like the user to be returned to a specific html id on Page A rather
than the top of the page but I am not sure how to do this.
These are the pertinent details as currently implemented:
I am using a submit button to link to Page B (named NpiSearch) from page A
(named Documentation) and the following:
setResponsePage( new NpiSearch(Documentation. this ));
to link from Page A to page B so that I can return to Page A when I am finsihed
with Page B.
public NpiSearch( final Page returnTo) {...
// display search results
final DataView<IDataProvider<Object>> dataView.....
public void populateItem( final Item item) {…
// display the search results details..for example
item.add( new Label( "lastName" , jsonNpiSearchDTO.getLastName()));
// select line and return to documentation page
final AjaxEventBehavior selectNpi = new AjaxEventBehavior( "onclick" ) {
@ Override
protected void onEvent(AjaxRequestTarget target) {
setResponsePage(returnTo);
}
}
}
}
In other parts of the application I am using code such as:
finishButton.add( new AttributeAppender( "href" , "#diagnosis" ));
But obviously this does not work in the code above.
So how do I return to a specific id after selecting a line in the DataView?
Any pointers would be great.
Nigel