0

how to capture ginfo onClose event

asked 2009-05-07 06:21:39 +0800

gmitev gravatar image gmitev
190 3

I am able to catch the onMapClick event when I click on a gmap, however this event will also fire when I click the 'x' on the ginfo bubble - I wish to distinguish between gmap click and ginfo click.

How can I get the onClose event (if there is such a thing) when I click on the 'x' of a ginfo bubble?

delete flag offensive retag edit

19 Replies

Sort by ยป oldest newest

answered 2009-05-19 02:47:35 +0800

gmitev gravatar image gmitev
190 3

Hi,
That sounded promising, but I am having two issues with this:-
1. onInfoChange gets called even when I click on the map, whenever i click map or ginfo, both onInfoChange and onMapClick get called.
2. gmap.getInfo() is always null, regardless whether ginfo has been open or not???

I am doing a couple of things differently, in that I do most of my work in the java controller, so I have added the onInfoChange evetn as follows:-

gmap.addForward("onInfoChange", self, "onInfoChange")


I cannot see why gmap.getInfo() is always null

link publish delete flag offensive edit

answered 2009-05-19 07:33:09 +0800

hideokidd gravatar image hideokidd
750 1 2

Hi,

1.onInfoChange is only fired when a ginfo is closed(visible->invisible),
and onMapClick is fired when you click any one of gmap, ginfo and gmarker.

2.gmap.getInfo() is not null when a ginfo is opened(visible),
when you click on a ginfo (except the 'x' button),
it won't return null.

3.in java class, you can try

gmap.addEventListener("onInfoChange",new GmapEventListener());

and the listener would be
public class GmapEventListener implements EventListener{
	@Override
	public void onEvent(Event event) throws Exception {
			
	}
}

I've not tried addForward yet.

link publish delete flag offensive edit

answered 2009-05-19 08:04:50 +0800

gmitev gravatar image gmitev
190 3

thanks hideokidd, I have tried this also, still no luck

and, onInfoChange is called when you click on the map also, as the ginfo is closed when you do this.


gmap.getInfo() is always null when onInfoChange gets called

I was contemmplating using double click on map and single click on 'x' just does nothing - as none of this seems to be working for me.

I have another issue (very different) but still related to ginfo.

I am using html to display my contents in ginfo, and I have a href that when I click it I wish for it to open a modal dialog - the question is how? Alternatively I would like to set up so that when href is clicked, it will call a java method that will do some processing and then open a modal dialog. I would've thought this would be common, to put href in ginfo, ie More Info link?

Any ideas?

link publish delete flag offensive edit

answered 2009-05-19 09:22:37 +0800

hideokidd gravatar image hideokidd
750 1 2

updated 2009-05-19 09:46:52 +0800

Hi,

1.onInfoChange is called when you click on the map also, as the ginfo is closed when you do this.
A: Yes, whatever the action you take, the event is called when ginfo is closed, it's possible that you click on gmap and ginfo is closed in the mean time.

2.gmap.getInfo() is always null when onInfoChange gets called
A:Yes, the event gets called means a ginfo is closed, so gmap.getInfo() will return null. because the method returns the active(opened or visible) ginfo. But it will return a ginfo if the ginfo appears and another ginfo get closed in the same time.

So we cannot know which ginfo is closed, we only could make a variable to store opened ginfo, thus this would help us know which ginfo is closed in the event.

3.I am using html to display my contents in ginfo, and I have a href that when I click it I wish for it to open a modal dialog - the question is how?
A:(1)use html : Let me think...
(2)use zk component : Toolbarbutton could help you to do hyperlinking, any with it you can open a window(by window.doModal()) to make this idea. Just personal suggestion.

link publish delete flag offensive edit

answered 2009-05-20 00:50:16 +0800

gmitev gravatar image gmitev
190 3

3.I am using html to display my contents in ginfo, and I have a href that when I click it I wish for it to open a modal dialog - the question is how?
A:(1)use html : Let me think...
(2)use zk component : Toolbarbutton could help you to do hyperlinking, any with it you can open a window(by window.doModal()) to make this idea. Just personal suggestion.


I know I could use toolbarbutton in other components, but how to add toolbarbutton in ginfo? I would like to have a link in ginfo, 'More Info', this would open my modal dialog (I have already impelemented and opening this modal dialog form a button press, I just need to be able to do it from a hyperlink in ginfo.

If it is possible to add toolbarbutton to ginfo this would work, but I dont think that is possible?

link publish delete flag offensive edit

answered 2009-05-20 03:16:39 +0800

hideokidd gravatar image hideokidd
750 1 2

updated 2009-05-20 03:19:13 +0800

Hi,

It's known bug that hyperlink in ginfo will not work on Firefox,
and ZK team has fixed it.
But the lastest version is not released.

Take zk componetns in ginfo is risky,
since that may mess up something with google API.
(And you could post the idea to zk features)

Would you develop other parts alternatively and wait for new release?

link publish delete flag offensive edit

answered 2009-05-20 03:32:28 +0800

gmitev gravatar image gmitev
190 3

Its not really an issue with hyperlink in firefox (or it may be), I have problem even in explorer, the issue is how to call a modal dialog from a hyperlink within ginfo. I can easily open another zul window, but not sure how to call a modal dialog or for that matter a java method from hyperlink?

As for the ginfo onClose, i will modify how i do this, i will change my onMapClick functionality so that it doesn't matter what is pressed, and add a button to perform the task I was doing prev - in short - I am happy to continue.

Thanks a lot for your help and advice, this modal dialog through hyperlink in ginfo would be a good one to solve though.

link publish delete flag offensive edit

answered 2009-05-21 01:34:43 +0800

hideokidd gravatar image hideokidd
750 1 2

Hi,

Try ths, does it work on your app?

<ginfo id="myinfo" open="true">
	<attribute name="content">
		<a href="JavaScript:;" onclick="window.open('http://www.google.com', '', 'width=400,height=200');">
			Open a popup window
		</a>
	</attribute>
</ginfo>

link publish delete flag offensive edit

answered 2009-05-26 01:56:11 +0800

gmitev gravatar image gmitev
190 3

this will open a new browser window, we want to be able to open a modal dialog in the same window. Ideally we want to be able to call a java method in the controller when a href is clicked.

link publish delete flag offensive edit
Your reply
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

RSS

Stats

Asked: 2009-05-07 06:21:39 +0800

Seen: 681 times

Last updated: May 26 '09

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