<attribute name="onClick"> : - what is the equivalent for on load?

asked 2010-08-24 11:26:07 +0800

Jameszk gravatar image Jameszk
48 1

Hi I have some code that can be used to update the screen when I click on a grid.

<grid id="summaryGrid" model="@{winTwSignals$composer.trainwireClassEventsList, load-after='timeRangeCombo.onChange, dateTimeBox.onChange'}"
style="width:800px; height:235px; overflow:auto">
<attribute name="onClick">
do stuff to update the screen

What code do I need to update the screen once the grid has loaded. (I need to do this because it has to do with bing maps, I need to manipulate a bing maps javasript object, unfortunately)

I have tried
<attribute name="onMove">
and onFocus
onLoad -everything. Can anyone make any suggestions? I want to update the sceen once it has loaded using javascript but without clicking (onclick).


delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2010-08-24 11:27:38 +0800

Jameszk gravatar image Jameszk
48 1

updated 2010-08-24 11:57:26 +0800

P.S. the full code in the attribute block is:

<attribute name="onClick">
jsonMapPins = gen.getPointsArrayJson();
jsonMapDetails = gen.getMapDetailsJson();
Clients.evalJavaScript("setupMap(" + jsonMapPins + ");");

Can anyone help?
Just to repeat, I need a replacement for "onClick" that doesn't require clicking - but works automatically, rather like an onload type event.

link publish delete flag offensive edit

answered 2010-08-24 13:13:14 +0800

robertpic71 gravatar image robertpic71
1275 1

Some ideas:

1.) Manage the databinding inside the composer:
Instead of load-after='timeRangeCombo.onChange, dateTimeBox.onChange'
you have to catch

binder.loadAll(); // fill the grid

2.) Create a dummy field (behind the grid)
<label id="updateMapDummy" visible="false" value="@{winTwSignals$composer.updateMap, load-after='timeRangeCombo.onChange, dateTimeBox.onChange'}"/>

public String updateMap() {
return null;

3.) Timer event (wait for 500 ms) and update onTimer


link publish delete flag offensive edit

answered 2010-08-24 20:05:13 +0800

samchuang gravatar image samchuang
4084 4


another idea, use onInitRender

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
	List ary = new ArrayList();
	ListModelList model = new ListModelList(ary);
	ListitemRenderer re = new ListitemRenderer() {
		public void render(Listitem item, Object data) throws Exception {
			item.appendChild(new Listcell(obj.toString));
	<grid id="grid" model="${model}">
		<attribute name="onInitRender">
			List l = model.getInnerList();
			for (Object obj : l) {
	<button label="Add model" onClick='model.add("2")'></button>

link publish delete flag offensive edit

answered 2010-08-25 02:21:52 +0800

Jameszk gravatar image Jameszk
48 1

updated 2010-08-25 02:22:56 +0800

Thanks guys, much appreciated! The "onInitRender" event did the trick.

I spent time reading though documentation, e.g. here:


and I did not find this "onInitRender" event documented. I now realise that I needed to look at the components methods, e.g.
The XUL Components Components Listbox

Live and learn.

Anyway, this has fixed my problem, much appreciated and long live open source! (We'll be buying more support soon by the way).


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




Asked: 2010-08-24 11:26:07 +0800

Seen: 714 times

Last updated: Aug 25 '10

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