0

ZATS trigger tooltip popup

asked 2013-09-23 14:27:52 +0800

aznavour gravatar image aznavour
26 3

Hi guys,

we test our entire application through ZATS, which works pretty good. Now we've came across the problem, that we need to check the content of the tooltip shown for XulElements.

We have some custom mechanisms implemented, but in the end its this what we do:

<label value="something" tooltip="generic_tooltip_popup, position=end_before" />

The "generic_tooltip_popup" is the ID of an included component that dynamically renders the content.

On the testing side, we would like to do something like this:

ComponentAgent label = ... query ...

ComonentAgent tootipPopup = label.openTooltip();
// or label.tooltip()
// or label.as(TooltipAgent.class).open()

Anyone can help us?

Cheers, Charles

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2013-09-24 02:24:14 +0800

dennis gravatar image dennis
3679 1 6
http://www.javaworld.com....

It does't support this feature yet, could you post a feature at http://tracker.zkoss.org/secure/Dashboard.jspa. and the possible workaround is get the popup component and call it's open directly.

link publish delete flag offensive edit
0

answered 2013-09-24 11:04:14 +0800

aznavour gravatar image aznavour
26 3

updated 2013-09-24 12:24:58 +0800

Hi dennis,

thanks for your reply. I cant get that working, as it fails with this error:

java.lang.IllegalStateException: Components can be accessed only in event listeners
at org.zkoss.zk.ui.impl.UiEngineImpl.getCurrentVisualizer(UiEngineImpl.java:259)
at org.zkoss.zk.ui.impl.UiEngineImpl.addResponse(UiEngineImpl.java:293)
at org.zkoss.zk.ui.AbstractComponent.response(AbstractComponent.java:1491)
at org.zkoss.zk.ui.AbstractComponent.response(AbstractComponent.java:1452)
at org.zkoss.zul.Popup.open(Popup.java:142)

Moreover, as we're using MVVM to bind the popup context and listen for then open event, I guess that we'll have to go through the full event system. I tried this:

// desktopId from targetAgent
Map<String, Object> data = EventDataManager.getInstance().build(
  new OpenEvent(Events.ON_OPEN, 
   (Component) tooltipComponentAgent.getDelegatee(),
   true,
   (Component)targetAgent.getDelegatee()));

((ClientCtrl)targetAgent.getClient()).postUpdate(desktopId, tooltipComponentAgent.getUuid(), Events.ON_OPEN, data, false);
((ClientCtrl)targetAgent.getClient()).flush(desktopId);

It's not that nice, but it seem to work ok.

Feature request: http://tracker.zkoss.org/browse/ZATS-26

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2013-09-23 14:27:52 +0800

Seen: 17 times

Last updated: Sep 24 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More