Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
4
Erster Beitrag:
vor 2 Monaten, 1 Woche
Letzter Beitrag:
vor 2 Monaten, 1 Woche
Beteiligte Autoren:
Fabrice Harari, JP

[WB23] - Moving a control and knowing its position

Startbeitrag von JP am 06.06.2018 15:00

Hi All

WB23 Dynamic site.

I have a template control which contains an image and a button. I have page on which i have an instance of this template control. The control can be moved by the background. The user can therefore click the control and move it around the web page. This all works fine.

The problem I have is knowing where the control has been moved to. I want to record the control's X and Y position so that I can restore the control to that position in future. However, I cannot see where I can know this information. I know that I can access the control's ..X ..Y properties but they return the default 0,0 position and not the new position the control has been moved to.

Any suggestions?

Antworten:

Hi JP

did you try in browser code? The server side would have no way of knowing the new positions... You can then send them to the server using ajaxexecute (by example)

Best regards

von Fabrice Harari - am 06.06.2018 17:43
Hi Fabrice

I was looking at this but there is an additional problem I have. A user can move a control around and I can use your suggestion to allow the user to send to the server the location of the moved control. However, my desire is to also allow a user to clone (i.e. duplicate) a control and move that around too. But now I would need a method to enumerate the controls on the page in order to send all their lcoations to the server. But one cannot use EnumControl() in browser code ... so is there a way, in browser code, to enumerate the various controls on a page and send their locations to the server?

Many thanks

von JP - am 11.06.2018 11:35
Hi JP

I do not htink that is possible, at least not that way, BUT, maybe, you can do something like that:
- the user select a control by clicking on it
- therefore in the browser code for that control, you can have a code that store the name of the control (myself..name) in an edit field or variable
- when the user moves the control, you can use that name to find the position and sending it immediately to the server

So no enumeration and sending everything at once, but one at a time, WHEN MOVED...

Best regards

von Fabrice Harari - am 11.06.2018 15:38
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.