Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Floating Button Panel on the form

Avatar

Level 7

Hi,

I want to design a FLOATING Panel for the action buttons on the form. So if i scroll form up or down ,The panel should float on different pages but at the bottom of the page.

FloatingPanel.JPG

I am designing above action buttons: Panel so that user sees these functionalities on every page at the bottom where he scrolls.

Please let me know your ideas how do i do it.

Please let me knw if I could explain my requirement clearly.

Regards

Sunil

3 Replies

Avatar

Level 8

Your question intrigued me, so I sought out to see if it's possible. The issue is, you can get the properties of where you are on the page when you scroll but unfortunately there are no events that fire when you do the scrolling. No event, no code execution to move the buttons.

So I put the code to move the buttons in a setInterval timer at form load and the performance is pretty bad (depending on the refresh rate). I'm still working on it.

In the mean time, can put the subform of buttons on the bottom of your masterpage...

Kyle

Avatar

Level 8

OK. I have a working example that you can find here:

http://www.fieldeffecttechnologies.com/AdobeForums/FloatingSubform.pdf

Here is the code I put in the docReady event of the Main subform (any object will do):

global.timer = app.setInterval(

"var curView = eval(this.viewState.toSource());"+

"yPos=curView.pageViewY>=0 ? (curView.pageViewY+4)*.655/curView.pageViewZoom:0;"+

"xfa.form.form1.pageSet.Page1.all.item(curView.pageViewPageNum).Buttons.y = yPos+\"pt\";",1000);//Change the refresh rate here (in milliseconds)

Every second the above code determines where the top of the form view is and based on the zoom, it determines the y coordinate for the 'floating' object to move. The .655 constant is what I've determined to be the relationship between the pageViewY's units and point units.

The object that this code is moving is a subform with buttons that is on masterpage Page1.

This particular code keeps the buttons at the top. It would take a little while longer to keep them at the bottom, since you'd really have to account for zoom and the page size. Probably getting the media box quads relative to the application window (haven't looked too far into it).

Also, there is a stop button to stop the timer with the same code in the docClose event of the Main subform:

app.clearInterval(global.timer);

delete global.timer;

Of course the annoying part is having the hourglass appear every once and awhile but unless the event model is updated in future releases to include scrolling, this is how it has to be done.

Hope this helps you and others. I had fun figuring it out.

Kyle

Avatar

Level 7

Thanks alot Kyle for your help.

This solution would be helpful for achiving similar functionality that i mentioned above but not the exact functionality that i am expecting as adobe designer is deficient of "scroll up event" but i find it realy usefull.

thanks alot for your help once again. tc

-

Sunil