com.vaadin.flow.dom.Element.callFunction()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(321)

本文整理了Java中com.vaadin.flow.dom.Element.callFunction()方法的一些代码示例,展示了Element.callFunction()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.callFunction()方法的具体详情如下:
包路径:com.vaadin.flow.dom.Element
类名称:Element
方法名:callFunction

Element.callFunction介绍

[英]Calls the given function on the element with the given arguments.

The function will be called after all pending DOM updates have completed, at the same time that Page#executeJavaScript(String,Serializable...) calls are invoked.

If the element is not attached, the function call will be deferred until the element is attached.
[中]使用给定参数对元素调用给定函数。
该函数将在所有挂起的DOM更新完成后调用,同时调用页面#executeJavaScript(字符串,可序列化…)调用调用。
如果未附加元素,则函数调用将推迟到附加元素。

代码示例

代码示例来源:origin: com.vaadin/flow-server

  1. /**
  2. * Calls the <code>blur</code> function at the client, making the component
  3. * lose keyboard focus.
  4. *
  5. * @see <a href=
  6. * "https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/blur">blur
  7. * at MDN</a>
  8. */
  9. default void blur() {
  10. getElement().callFunction("blur");
  11. }

代码示例来源:origin: com.vaadin/vaadin-date-picker-flow

  1. /**
  2. * <p>
  3. * Description copied from corresponding location in WebComponent:
  4. * </p>
  5. * <p>
  6. * Opens the dropdown.
  7. * </p>
  8. */
  9. protected void open() {
  10. getElement().callFunction("open");
  11. }

代码示例来源:origin: com.vaadin/vaadin-notification-flow

  1. /**
  2. * <p>
  3. * Description copied from corresponding location in WebComponent:
  4. * </p>
  5. * <p>
  6. * Opens the notification.
  7. * </p>
  8. */
  9. protected void open() {
  10. getElement().callFunction("open");
  11. }

代码示例来源:origin: com.vaadin/vaadin-select-flow

  1. /**
  2. * <p>
  3. * Description copied from corresponding location in WebComponent:
  4. * </p>
  5. * <p>
  6. * Manually invoke existing renderer.
  7. * </p>
  8. */
  9. protected void render() {
  10. getElement().callFunction("render");
  11. }

代码示例来源:origin: com.vaadin/vaadin-context-menu-flow

  1. /**
  2. * <p>
  3. * Description copied from corresponding location in WebComponent:
  4. * </p>
  5. * <p>
  6. * Closes the overlay.
  7. * </p>
  8. */
  9. protected void close() {
  10. getElement().callFunction("close");
  11. }

代码示例来源:origin: com.vaadin/vaadin-context-menu-flow

  1. /**
  2. * <p>
  3. * Description copied from corresponding location in WebComponent:
  4. * </p>
  5. * <p>
  6. * Opens the overlay.
  7. * </p>
  8. */
  9. protected void open() {
  10. getElement().callFunction("open");
  11. }

代码示例来源:origin: com.vaadin/vaadin-crud-flow

  1. /**
  2. * Opens or closes the editor. In most use cases opening or closing the editor
  3. * is automatically done by the component and this method does not need to be called.
  4. *
  5. * @param opened true to open or false to close
  6. */
  7. public void setOpened(boolean opened) {
  8. getElement().callFunction("set", "editorOpened", opened);
  9. }

代码示例来源:origin: com.vaadin/vaadin-date-picker-flow

  1. /**
  2. * <p>
  3. * Description copied from corresponding location in WebComponent:
  4. * </p>
  5. * <p>
  6. * Closes the dropdown.
  7. * </p>
  8. */
  9. protected void close() {
  10. getElement().callFunction("close");
  11. }

代码示例来源:origin: com.vaadin/vaadin-context-menu-flow

  1. private void updateOpenOn() {
  2. if (target != null) {
  3. target.getElement().callFunction(
  4. "$contextMenuConnector.updateOpenOn", openOnEventName);
  5. }
  6. }

代码示例来源:origin: com.vaadin/vaadin-text-field-flow

  1. protected void checkValidity() {
  2. getElement().callFunction("checkValidity");
  3. }

代码示例来源:origin: com.vaadin/vaadin-button-flow

  1. /**
  2. * Executes a click on this button at the client-side. Calling this method
  3. * behaves the same as if the user would have clicked on the button.
  4. */
  5. public void clickInClient() {
  6. getElement().callFunction("click");
  7. }

代码示例来源:origin: com.vaadin/vaadin-notification-flow

  1. /**
  2. * <p>
  3. * Description copied from corresponding location in WebComponent:
  4. * </p>
  5. * <p>
  6. * Closes the notification.
  7. * </p>
  8. */
  9. protected void close() {
  10. getElement().callFunction("close");
  11. }

代码示例来源:origin: appreciated/vaadin-app-layout

  1. public void toggleDrawer() {
  2. getDrawer().getElement().callFunction("toggle");
  3. }

代码示例来源:origin: com.vaadin/vaadin-charts-flow

  1. @Override
  2. public void seriesStateChanged(SeriesStateEvent event) {
  3. if (event.isEnabled()) {
  4. chart.getElement().callFunction("__callSeriesFunction", "show",
  5. getSeriesIndex(event));
  6. } else {
  7. chart.getElement().callFunction("__callSeriesFunction", "hide",
  8. getSeriesIndex(event));
  9. }
  10. }

代码示例来源:origin: com.vaadin/vaadin-charts-flow

  1. @Override
  2. public void dataRemoved(DataRemovedEvent event) {
  3. chart.getElement().callFunction("__callPointFunction", "remove",
  4. getSeriesIndex(event), event.getIndex());
  5. }

代码示例来源:origin: com.vaadin/vaadin-charts-flow

  1. @Override
  2. public void axisRescaled(AxisRescaledEvent event) {
  3. chart.getElement().callFunction("__callAxisFunction", "setExtremes",
  4. event.getAxis(), event.getAxisIndex(),
  5. event.getMinimum().doubleValue(),
  6. event.getMaximum().doubleValue(), event.isRedrawingNeeded(),
  7. event.isAnimated());
  8. }

代码示例来源:origin: com.vaadin/vaadin-charts-flow

  1. @Override
  2. public void seriesAdded(SeriesAddedEvent event) {
  3. chart.getElement().callFunction("__callChartFunction", "addSeries",
  4. chart.getJsonFactory().parse(ChartSerialization.toJSON(
  5. (AbstractConfigurationObject) event.getSeries())));
  6. }

代码示例来源:origin: com.vaadin/vaadin-charts-flow

  1. @Override
  2. public void itemSliced(ItemSlicedEvent event) {
  3. chart.getElement().callFunction("__callPointFunction", "slice",
  4. getSeriesIndex(event), event.getIndex(), event.isSliced(),
  5. event.isRedraw(), event.isAnimation());
  6. }

代码示例来源:origin: com.vaadin/vaadin-charts-flow

  1. @Override
  2. public void seriesChanged(SeriesChangedEvent event) {
  3. chart.getElement().callFunction("__callSeriesFunction", "update",
  4. getSeriesIndex(event),
  5. chart.getJsonFactory().parse(ChartSerialization.toJSON(
  6. (AbstractConfigurationObject) event.getSeries())));
  7. }

代码示例来源:origin: com.vaadin/vaadin-charts-flow

  1. @Override
  2. public void dataAdded(DataAddedEvent event) {
  3. if (event.getItem() != null) {
  4. chart.getElement().callFunction("__callSeriesFunction",
  5. "addPoint", getSeriesIndex(event),
  6. chart.getJsonFactory().parse(
  7. ChartSerialization.toJSON(event.getItem())),
  8. true, event.isShift());
  9. }
  10. }

相关文章