gx_updatePagePart(panelId) with Transforms

Hi Ohad,

Although gx_updatePagePart(panelId) works well (refer to my previous post), it seems that transformations are not possible.
Is this assumption correct?

For example (in UserCompletionTransform1):

public void onComplete (GXRenderEvent event)
{
GXITag[] tag = event.getScreenTagModel().getTags();

for (int i=0; i<tag.length; i++)
{
	tag[i].setAttribute("style", "color: red");	
}

}

This has no effect on the rendered output.

Is there a way to apply transforms in this case?

Regards…

Hi Cquaj,

It works fine for me. Look up the registerInstantTransforms method in the GXInstantLogicContext.java and check if the following line is uncommented:

instantConfig.addCompletionListener(new transforms.UserCompletionTransform1());

My guess is it’s commented.
Let me know if this helps,
Regards,
Ohad

Hi Ohad,
I am trying to apply a transformation on the first host screen after login. The transform must be applied only once.

In GXInstantLogicContext, I have the following:


public void gx_onInit()
{
	super.gx_onInit();
	getGXAppConfig().setIsInstant(true);
        
	GXRenderConfig instantConfig = getGXAppConfig().getInstantConfig();
	if (getSession().getAttribute("fromLogin").equals("yes"))
	{        	
		instantConfig.addCompletionListener(new transforms.UserCompletionTransform1());
	}
}

public void gx_preRender()
{
	super.gx_preRender();

	registerInstantTransforms();
}

public void registerInstantTransforms() 
{
        GXRenderConfig instantConfig = getGXAppConfig().getInstantConfig();
        
        if (getSession().getAttribute("fromLogin").equals("yes"))
        {
        	getSession().setAttribute("fromLogin", "no");
        }
        else
        {
        	instantConfig.removeAllListeners();
        }
}

…and then my code in UserCompletionTransform1.

I have System.out.println in UserCompletionTransform1 to verify that the code is being executed.

The transform however is not applied.

I have another application where user tranforms are being applied without problem. This application does not use AJAX (gx_updatePagePart).
This is why I though that gx_updatePagePart may be the problem.

Are you testing using gx_updatePagePart(PanelId) / supportPartialPageRendering=true?

Regards…

Hi,

Will somebody please confirm that transformations fuunction correctly under the conditions mentioned in my last post (i.e. using gx_updatePagePart(PanelId) / supportPartialPageRendering=true).

Regards…

Hi Cquaj,

Yes, I used gx_updatePagePart(PanelId) / supportPartialPageRendering=true.
It works OK. the transformation is being executed.

However, placing the addCompletionListener in the gx_onInit method could cause the problem. I would recommend handling the logic of adding/removing transformations from inside the registerInstantTransforms method.

Let me know if that helps,
Best regards,
Ohad

Thanks Ohad,

Three further issues:

1) When using instant pages/gx_updatePagePart(), the cursor, tab-key and autotab functionality does not work. You have to place the cursor with the mouse, etc. Is there a way to fix this?

2) Is it possible to change the style attribute of gx_ScreenArea? I need to ensure that the div height is constant (say 480px).

3) The following code in a transform (using instant pages/gx_updatePagePart()):


GXScreenBuffers scrBuffer = event.getHostScreen().getBuffers(false);
String buffer = scrBuffer.getScreenBuffer();

sets buffer to null.
Note that the required GXWebAppConfig has been done in GXBasicContext. Also I have ticked ‘Return content of hidden fields’ in Screen Content properties of the Applinx application. Is this to be expected?

By the way I’m using Applinx 8.1.2.0000.0005.

Regards…

Hi Cquaj,

  1. I’ve tested this feature with the gx_updatePagePart() and it works fine for me. The Cursor is placed in the correct place and the autotab works as it should. Check the web application configuration and see if “Tab on input fields only” and “Automatic skip for all input fields” are turned on.

  2. The gx_screenArea height attribute is set in runtime and cannot be changed. However, you can set the height of the object (TD, DIV…) containing the gx_screenArea.

  3. By default, the baseObject doesn’t return the screen buffer (for performance reasons). In order to return the screen buffer, open the GXBasicContext.java and add the following code to the gx_initSessionConfig method:

GXWebAppConfig gx_appConfig = getGXAppConfig();
gx_appConfig.getSessionConfig().addVariable(GXBaseObjectConstants.GX_VAR_RETURN_SCREEN_BUFFERS, GXBaseObjectConstants.GX_VAR_VAL_BUFFERS_SCREEN_DATA);

NOTE:
This may result in some performance overhead, since the screen buffer will now return everytime a new screen arrives.