cancel
Showing results for 
Search instead for 
Did you mean: 

change updateevent

Former Member
0 Kudos

Hi

Is it possible to change the UpdateEvent that runs on an applet?

My problem is that there are about 20 applets on my page, and I think it's causing issues, especially with older machines.

So I want to do something like this

document.genericApplet.setQueryTemplate("q1")

document.genericApplet.setDisplayTemplate("d1")

document.genericApplet.setUpdateEvent("u1")

document.genericApplet.updateGrid(true)

Is there a way to do this?

I am using 12.0.2b88. On my PC I have JRE 1.6.0_02, many users have 1.4.2_12 or 1.5.11

Thanks

Nick

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Yes. The existing published/documented interfaces will continue to work for backward compatability, in the new 12.1 version of the applets. Obviously new javascript functions are also available for the new enhanced functionality.

Fran

Former Member
0 Kudos

Hi Nick,

Even I faced same problem, I was using more than 8 applets.

I hope below solution could help you.

we know there are 4 events for applets like

1.Creation Event, (Creation of applet and initialization is done here)

2.First Update Event,(whenever Query runs First Update event happens,this is the guarentee that applet is fully loaded)

3.Update Event,(this is for every next auto refresh,it executes query again)

4.selection Event.(everyone knows no need to explain)

Best practise to avoid applet loading problem is call function in First update event.

call same Function name in all Applets, Keep one global variable with initial value 0 , once applet loaded increment the counter value.

Example:

<Applet1>

<PARAM NAME="QueryTemplate" VALUE="query name">

<PARAM NAME="FirstUpdateEvent" VALUE="Function1">

</applet1>

<Applet2>

<PARAM NAME="QueryTemplate" VALUE="query name">

<PARAM NAME="FirstUpdateEvent" VALUE="Function1">

</applet2>

function Function1()

{

counter=counter+1;

}

then write your actual function to do what has to happen after the corresponding applet has loaded checking counter.

function perform()

{

if(counter==2)//that means do this only after second applet loaded

{

---

---

} }

Dont know how far this helps you, but I have tried to explain what I know.

Thanks,

Rao

Former Member
0 Kudos

Hi Nick,

In XMII 12.1 thee applets were completely rewritten to add new functionality and to convert them all to Swing. Unpublished methods like getHelper() will no longer work since they are now protected and the general eventing model is handled completely differently though all published and documented methods will still work.

Fran Simon

Former Member
0 Kudos

There you have it, right from the source! Thanks, Fran. As I said, "use at your own risk...", 'cuz things will change over time.

Fran/John, will there be 100% forward compatibility for scripting and properties with the new applets or will people need to rework any of the pages? Or will the old applets keep working "as is" and be shipped alongside the new ones?

See ya in Nashville.

Former Member
0 Kudos

If you aren't using any charts, I would recomend using AJAX techniques or the iCommand and build your HTML dynamically. It may take a little longer to build, but In my opinion you will get a much better user experience.

Former Member
0 Kudos

Hi, Nick. I would suspect that officially the answer is no, but technically, the answer is yes. You can use setSelectionEvent, setUpdateEvent, and setCreationEvent to do what you want to do. Those are the only three that can be set dynamically, AFAIK.

Former Member
0 Kudos

Rick

I would suspect that officially the answer is no, but technically, the answer is yes. You can use setSelectionEvent, setUpdateEvent, and setCreationEvent to do what you want to do

This is exactly what I wanted. Could you post an example?

As this isn't documented anywhere, will it still be available going forward?

Thanks

Nick

Former Member
0 Kudos

Hi, Nick.

It works similarly to what you had in your initial posting. Simply pass the name of the Javascript function that you want invoked when the event is fired as the parameter to the setXXX method, as in:

myApplet.getHelper().setSelectionEvent("MySelectionHandler");

The key is the hidden AppletHelper object which sits behind each MII applet and does a lot of the script-related tasks.

Use at your own risk!

Rick

Former Member
0 Kudos

You can disable/enable an event but I did not understand "change".

Change to what?

Please explain.

agentry_src
Active Contributor
0 Kudos

20 applets seems like a high number for a single page. Can you split them out into multiple pages?

Mike

Former Member
0 Kudos

Basically my page looks like this


+--------------------------------------------------------------------------------+
| +---------------------------------------------------------------------------+  |
| |                             Order Header Data                             |  |
| +---------------------------------------------------------------------------+  |
| +-------+  +----------------------------------------------------------------+  |
| |   T   |  |                                                                |  |
| |   A   |  |                       Order detail                             |  |
| |   B   |  |                                                                |  |
| |   S   |  |                                                                |  |
| +-------+  +----------------------------------------------------------------+  |
+--------------------------------------------------------------------------------+

There are about eight tabs down the side, which each load different sets of data into the "Order Detail" section e.g. Operations, Material. There are also a set of buttons along the bottom which allow you to perform actions, and most of these have an applet behind then, eg Confirm Operation. There are also upplets for loading and updating the header data.

What I wanted to do was to reduce these all onto the same applet and depending on which button was pressed would run a different script on the "updated" event.

I suppose I could use iframes to reduce the applets on a single page.

regards

Nick

PS Did anyone else hava a ZX81?

jcgood25
Active Contributor
0 Kudos

Nick,

Did your ZX81 have a cassette tape and thermal printer that looked like a cash register receipt?

The iFrame concept would probably provide a much better user experience and scalable solution. If your irpt page included event overrides that pointed to functions in an included js file it would be quite easy:

<APPLET NAME="OrderDetailGrid"....iGrid....>

<PARAM NAME="QueryTemplate" VALUE="Project/Folder/Query"> <PARAM NAME="DisplayTemplate" VALUE="Project/Folder/Grid">

<PARAM NAME="SelectionEvent" VALUE="OrderDetailGrid_">

</APPLET>

Then a simple page reference to your iFrame with "Page.irpt?TAB=Operations" or "Page.irpt?TAB=Material" could be very easy.

This would effectively be the same applet (one page to maintain and the TAB specific details handled in the script).

Regards,

Jeremy

Former Member
0 Kudos

The only problem with using multiple IFRAMEs is that they can be a real P.I.T.A to get the browser to layout properly (e.g. IFRAMES nested inside tables).