PDA

View Full Version : WebSetResponsiveness on piHeight and piWidth (df18.1a3)



Roel Westhoff [W4]
8-Apr-2015, 09:21 AM
Hi All,

In a2 and a3 WebSetresponsivesness is introduced. Previously we were 'told' to use onResizeWindow to manipulate the size of panels, groups etc.

Q: How can I get the same functionality as onResizeWindow with WebSetResponsiveness? Within a onResizeWindow it was possible to make calculations based on the size of the window (iWindowWidth and iWindowHeight). I looked at the documentation but i can't find a 'solution'. Is there a trick to using Websetrepsonsiveness to get the same results?

Tia
Roel

Harm Wibier
12-Apr-2015, 01:50 PM
We indeed felt that we needed a better solution than the OnWindowResize for multiple reasons. The idea behind WebSetResponsive is that you are providing fixed values for specific devices. As the exact dimensions of all these different devices out there you’ll have design your applications with a specific "stretchability" in mind and the column layout system already gives you that. As you’ll see in our samples and presentations we mainly use WebSetResponsive on properties like pbRender, piColumnCount, piColumnIndex and piColumnSpan properties. Of course piWidth and piHeight would be properties that it would make sense to use them on but you indeed can only provide fixed values for the predefined categories. If you need calculated values you’ll still have to use OnWindowResize.

Roel Westhoff [W4]
17-Apr-2015, 01:14 AM
Hello Harm,

The onWindowResize is not responsive and is an obsolete procedure for me. I want to make calculations on the client and determine piWidth and piHeight based on the clientWindowHeight and clientWindowWidth. The rebuilding of the screen will be instant ans smooth and not like with onWindowResize in bits and pieces

The websetresponsive property with fixed values is not enough.

Roel

Harm Wibier
17-Apr-2015, 02:15 AM
You can use psClientOnWindowResize if it has to happen on the client without calling the server.

Roel Westhoff [W4]
17-Apr-2015, 06:17 AM
Hello Harm,

I'm aware of this property but have no clue how to use it. From the documentation i can deduct that i have to use javascript.
One of the main reasons why i use Dataflex is that i don't have to use Javascript.

It would be nice if Daw could show us how to build responsive design's using psClientWindowsResize and giving developers full calculated control over their design's.
As said before. The fixed value approach of websetresponsive doesn't cut it for me. Am i the only one?

Roel

Harm Wibier
17-Apr-2015, 06:40 AM
There is documentation on client-side event handlers under "Developing Web Applications > Client-Side Event Handlers".

In the WebOrder sample put include the following JavaScript:


function resizeDemoTreeview(oEvent){
oWebApp.oDemoTreeView.oLeftPanel.set("piWidth", oEvent.aParams[0] / 4);
}


And under DataFlex add the folowing line to the DemoTreeView view:


Set psClientOnResizeWindow to "resizeDemoTreeview"

Roel Westhoff [W4]
17-Apr-2015, 08:21 AM
Hello Harm,

Thank you for sending me the code and redirecting me to parts of the help. Missed this...

I implemented your code in the default weborder app.

Is it me but the implementation doesn't look like it is responsive. The size of the oDemoTreeView doesn't smoothly react to resizing the window. The rest the view (forms etc) does.
It only resizes after i release the mousebutton.

Roel

Harm Wibier
17-Apr-2015, 08:47 AM
That is most likely because the OnWindowResize event (which includes the psClientOnWindowResize) uses a little timeout to wait if the resize is still in progress to prevent it from flooding the server with calls and because the framework resize can be an expensive operation. You could get around that by using the standard browser resize event instead of the framework its OnWindowResize.

Roel Westhoff [W4]
17-Apr-2015, 11:51 AM
Hello Harm,

You could get around that by using the standard browser resize event instead of the framework its OnWindowResize.

I guess i have to admit. I have no idea how i can do this. My javascript knowledge is lacking. Could you help me out ?

Tia
Roel

Roel Westhoff [W4]
19-Apr-2015, 03:21 AM
Hello Harm,

I fiddled around with the DOM resize functions but this does not solve the problem. The df javascript resize interferes with dom javascript and gives erratic behavior.
Plse have a look at this and give us dataflex developers a solid df solution that respects the rules of seemless responsiveness (so no server actions)

Roel