Re: AjaxSlider
Re: AjaxSlider
- Subject: Re: AjaxSlider
- From: Chuck Hill <email@hidden>
- Date: Tue, 14 Oct 2008 09:51:08 -0700
Hi David,
On Oct 14, 2008, at 8:17 AM, David Ress wrote:
I am working a WO application for the US Air Force, and finally have
been able to upgrade the server from 10.3 to 10.4. This opened up the
opportunities to use Java 1.5 as well as adapting the Wonder
frameworks.
Lots of big and good changes there.
I need to utilize a slider within a component. I believe the
AjaxExample
does not pass the current value of the slider back to the component,
which is what I need my component to do.
Is there an example which shows the AjaxSlider sending its value
back to the
component available for study? Otherwise, any hints as to how I can
send
the value back to the component for further processing?
The AjaxGridNavBar does this. Here is an example set of bindings:
BatchSlider: AjaxSlider {
orientation = "horizontal";
value = currentBatchIndex;
minimum = 1;
maximum = displayGroup.batchCount;
onChangeServer = updateGridContainer;
onSlide = "function(v) { $('currentBatch').innerHTML =
Math.round(v) }";
onChange = "function(v) { $('currentBatch').innerHTML =
Math.round(v) }";
id = "BatchSlider";
}
The relevant code from AjaxGridNavBar:
/**
*Intended to be bound to Ajaxslider for selection of batch to display.
*
*@paramnewValue
* new batch number from AjaxSlider
*/
public void setCurrentBatchIndex(Number newValue) {
// Right now the value returned is a BigDecimal. KVC changes this to
an
// int by narrowing, so that 4.9876402 becomes 4.
// If we round this instead, the slider movement is more inutuitive,
// especially with smaller batch sizes.
if (newValue instanceof BigDecimal) {
int roundedIndex = new Float(((BigDecimal) newValue).floatValue() +
0.5).intValue();
displayGroup().setCurrentBatchIndex(roundedIndex);
}
else {
displayGroup().setCurrentBatchIndex(newValue.intValue());
}
}
/**
*@return value for AjaxSlider
*/
public int currentBatchIndex() {
return displayGroup().currentBatchIndex();
}
Does that help?
Chuck
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >AjaxSlider (From: David Ress <email@hidden>) |