Dashboard > WebObjects > Programming__WebObjects-Project WONDER-Frameworks-Ajax-AjaxHighlight
  WebObjects Log In View a printable version of the current page.  
  Programming__WebObjects-Project WONDER-Frameworks-Ajax-AjaxHighlight
Added by Steven Mark McCraw, last edited by Steven Mark McCraw on Jul 08, 2007
Labels: 
(None)

AjaxHighlight provides a convenient way to queue up an object as highlighted so that it gets a highlight effect when the next page renders.

In the action prior to returning the page that will show a highlight, you can call Computer code|AjaxHighlight.highlight(theObject). The object you highlight could be a String, an EO, or whatever object makes sense in your context.

Then you simply bind

value = ..
on this component on the following page. If the value matches an object that was flagged as highlighted, the container you specify will receive the highlight effect. This component can also generate its own container if you do not specify another container id.

So you can do:

private Person _person;
...
public WOActionResults savePerson() {
	_person.editingContext().saveChanges();
	AjaxHighlight.highlight(_person);
	return pageWithName(PersonListPage.class);
}

and in PersonListPage:

<ul>
	<wo:WORepetition list = "$people" item = "$repetitionPerson">
		<wo:AjaxHighlight elementName = "li" value = "$repetitionPerson"><wo:str value = "$repetitionPerson.name"/></wo:AjaxHighlight>
	</wo:WORepetition>
</ul>

When the page loads, the newly created person will get the scriptaculous Computer code|Effect.Highlight yellow flash effect (you can also specify

effect = "SomeOtherScriptaculousEffect"
if you don't like Computer code|Effect.Highlight).

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators