UserManager - update UI

Questions and answers on developing, deploying and using plugins and JavaBeans

UserManager - update UI

Postby irene.meyer1422261887 » Mon Jan 26, 2015 11:10 am

Hi,

My method changes the background-color of a field depending on the status of an object (e.g. state 1 = green, state 2 = yellow...)

I run the method with the UserManger plugin an it works perfectly on the client where I give the command I get the message on other clients but it does not update
the color.

Code: Select all
var vClients = plugins.UserManager.getClients()
   for (var i = 0; i < vClients .length; i++)
   {
       var client = vClients [i];
       client.executeMethod(globals.onDataChangeActionP2(actionName,statePerc));
       client.sendMessage(i18n.getI18NMessage('color changed'))           
   }


Can someone point out what is wrong?
User avatar
irene.meyer1422261887
 
Posts: 34
Joined: Mon Jan 26, 2015 10:44 am

Re: UserManager - update UI

Postby irene.meyer1422261887 » Mon Jan 26, 2015 3:19 pm

Update:

I tried something very simple in my global method like:

forms.object_controlpannel.elements.tabs_action.tabIndex = 2;

But it doesn't work. It seems that UserManager has a problem with UI because other methods changing only the data works well.
User avatar
irene.meyer1422261887
 
Posts: 34
Joined: Mon Jan 26, 2015 10:44 am

Re: UserManager - update UI

Postby ngervasi » Mon Jan 26, 2015 4:29 pm

I don't think you can interact with the GUI of remote clients, what if a client has not yet loaded that form?
Nicola Gervasi
sintpro.com
SAN Partner
ngervasi
 
Posts: 1485
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: UserManager - update UI

Postby irene.meyer1422261887 » Mon Jan 26, 2015 5:31 pm

I am sure that all clients have loaded that form, is the only form they can use.
May be I have to explain a little bit better. This app. is a "serious game". 4 people at time are invited to play the game together and the data the game produces is used for research.

Each of them has an object_kind (e.g. street, or water etc.)
In the form all objects are displayed with a color depending of their state. Depending of an action a player fire on his object, the object will change color. The problem is that all objects must be updated on all players.

May be is UserManager never ment to do that, but how else?
User avatar
irene.meyer1422261887
 
Posts: 34
Joined: Mon Jan 26, 2015 10:44 am

Re: UserManager - update UI

Postby jdbruijn » Tue Jan 27, 2015 9:45 am

I guess you could have a look at the onDataBroadcast event of the solution to trigger your color changes.
Jos de Bruijn
Focus Feedback BV
Servoy Certified Developer
Image
jdbruijn
 
Posts: 492
Joined: Sun Apr 11, 2010 6:34 pm

Re: UserManager - update UI

Postby patrick » Tue Jan 27, 2015 3:31 pm

Is the method really fired in the client? Could you show a message or something before you do something UI related?

I can't see why something UI related shouldn't work really... In any case, I wouldn't say it's a plugin issue. The plugin uses the same mechanism that is used for the deep link, I think. What works there, should work with the plugin.
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany


Return to Plugins and Beans

Who is online

Users browsing this forum: Bing [Bot] and 10 guests