currentcontroller.refresh() ?

Questions, tips and tricks and techniques for scripting in Servoy

currentcontroller.refresh() ?

Postby mattman » Thu Mar 04, 2004 4:11 am

I'm working with moving objects around on a form. There are some cool things that could be done. However, I'm running into an issue.

Place a TEXT_AREA field on a form and make it stretch from the leftmost edge to the rightmost. Name is 'body' in the name property. Meaning the body field covers the whole width of the form. Anchor is to the left, right, top and bottom.

Turn on scrollbars so the vertical is always (V:a H:wn)

Now run this code and you'll find that your form will not refresh to show the scroll bar. It just looks like the field gets pushed to the right.

Code: Select all
var x = elements.body.getLocationX();
var y = elements.body.getLocationY();
var w = elements.body.getWidth();
var h = elements.body.getHeight();

var a = 185; // The amount you'd like to shift an object over.

// Compare against it's original leftmost x coordinate.

if(x == 4){
   elements.body.setLocation(x + a, y);
   elements.body.setSize(w - a, h);
}else{
   elements.body.setLocation(x - a, y);
   elements.body.setSize(w + a, h);
}
application.showForm(letters_Edit);
application.output(x);


As you can see. I've tried the application.showForm() function to no avail. Is this a bug or is there another method for making sure the scrollbar, which gets moved off screen is refreshed.

Note: Swapping the .setSize and .setLocation does not fix this. You would think it would resize the field then move it and the scrollbar would stay. But it doesn't work this way. Is this a bug? Need new method?
Matt Petrowsky
mattman
 
Posts: 160
Joined: Wed Aug 06, 2003 8:23 am
Location: Murrieta, CA

Postby jcompagner » Tue Mar 09, 2004 6:24 pm

fixed in RC9. will be layout/repainted now.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Methods

Who is online

Users browsing this forum: No registered users and 41 guests