use of com.servoy.j2db.server.headlessclient.MainPage in project servoy-client by Servoy.
the class WebBaseButton method fireOnRender.
public void fireOnRender(boolean force) {
if (scriptable != null) {
boolean isFocused = false;
IMainContainer currentContainer = ((FormManager) application.getFormManager()).getCurrentContainer();
if (currentContainer instanceof MainPage) {
isFocused = this.equals(((MainPage) currentContainer).getFocusedComponent());
}
if (force)
scriptable.getRenderEventExecutor().setRenderStateChanged();
scriptable.getRenderEventExecutor().fireOnRender(isFocused);
}
}
use of com.servoy.j2db.server.headlessclient.MainPage in project servoy-client by Servoy.
the class WebBaseLabel method fireOnRender.
public void fireOnRender(boolean force) {
if (scriptable instanceof ISupportOnRenderCallback) {
boolean isFocused = false;
IMainContainer currentContainer = ((FormManager) application.getFormManager()).getCurrentContainer();
if (currentContainer instanceof MainPage) {
isFocused = this.equals(((MainPage) currentContainer).getFocusedComponent());
}
if (force)
((ISupportOnRenderCallback) scriptable).getRenderEventExecutor().setRenderStateChanged();
((ISupportOnRenderCallback) scriptable).getRenderEventExecutor().fireOnRender(isFocused);
}
}
use of com.servoy.j2db.server.headlessclient.MainPage in project servoy-client by Servoy.
the class WebCellAdapter method valueChanged.
public void valueChanged(ModificationEvent e) {
MainPage mp = view.findParent(MainPage.class);
if (mp != null)
mp.touch();
IRecord record = e.getRecord();
Iterator iterator = ((MarkupContainer) view.getTable()).iterator();
while (iterator.hasNext()) {
Object next = iterator.next();
if (next instanceof ListItem) {
ListItem li = (ListItem) next;
Object modelObject = li.getModelObject();
if (record == null || modelObject == record) {
boolean hasOnRender = false;
Iterator iterator2 = li.iterator();
while (iterator2.hasNext()) {
ArrayList<Object> cellDisplays = new ArrayList<Object>();
Object cell = iterator2.next();
cell = CellContainer.getContentsForCell((Component) cell);
if (cell instanceof WebCellBasedViewListViewItem) {
Iterator listItemIte = ((WebCellBasedViewListViewItem) cell).iterator();
while (listItemIte.hasNext()) {
Object listItemDisplay = listItemIte.next();
if (listItemDisplay instanceof WrapperContainer) {
listItemDisplay = ((WrapperContainer) listItemDisplay).getDelegate();
}
cellDisplays.add(listItemDisplay);
}
} else {
cellDisplays.add(cell);
}
for (Object cellDisplay : cellDisplays) {
if (cellDisplay instanceof IProviderStylePropertyChanges && cellDisplay instanceof IDisplayData && ((IDisplayData) cellDisplay).getDataProviderID() == dataprovider) {
// only test if it is not already changed
view.checkForValueChanges(cellDisplay);
// do fire on render on all components for record change
if (cellDisplay instanceof ISupportOnRender && cellDisplay instanceof IScriptableProvider) {
IScriptable so = ((IScriptableProvider) cellDisplay).getScriptObject();
if (so instanceof AbstractRuntimeRendersupportComponent && ((ISupportOnRenderCallback) so).getRenderEventExecutor().hasRenderCallback()) {
String componentDataproviderID = ((AbstractRuntimeRendersupportComponent) so).getDataProviderID();
if (record != null || (e.getName() != null && e.getName().equals(componentDataproviderID))) {
((ISupportOnRender) cellDisplay).fireOnRender(true);
hasOnRender = true;
}
}
}
}
}
}
if (record != null || (!hasOnRender && !canChangeValue(e)))
break;
}
}
}
}
use of com.servoy.j2db.server.headlessclient.MainPage in project servoy-client by Servoy.
the class ScrollResponseHeaderContainer method setColumnThatRequestsFocus.
/**
* Requests focus for the cell in the web cell view corresponding to the selected record and to the given column identifier component.
*
* @param columnIdentifierComponent the Component that identifies a column for java script.
*/
public void setColumnThatRequestsFocus(final Component columnIdentifierComponent) {
focusRequestingColIdentComponent = null;
if (currentData == null)
return;
Component cell = getCellToFocus(columnIdentifierComponent);
if (cell != null) {
IMainContainer currentContainer = ((FormManager) application.getFormManager()).getCurrentContainer();
if (currentContainer instanceof MainPage) {
((MainPage) currentContainer).componentToFocus(cell);
} else {
// $NON-NLS-1$
Debug.trace("focus couldnt be set on component " + cell);
}
} else {
focusRequestingColIdentComponent = columnIdentifierComponent;
}
}
use of com.servoy.j2db.server.headlessclient.MainPage in project servoy-client by Servoy.
the class WebDataRadioChoice method fireOnRender.
public void fireOnRender(boolean force) {
if (scriptable != null) {
boolean isFocused = false;
IMainContainer currentContainer = ((FormManager) application.getFormManager()).getCurrentContainer();
if (currentContainer instanceof MainPage) {
isFocused = this.equals(((MainPage) currentContainer).getFocusedComponent());
}
if (force)
scriptable.getRenderEventExecutor().setRenderStateChanged();
scriptable.getRenderEventExecutor().fireOnRender(isFocused);
}
}
Aggregations