flash shared object is not working across multiple PCs - browser

I am using SharedObject to save some persistent information (such as visited slide, etc) on user browser. For example, if user visited the slide, it will highlight the button that takes them to that slide. If they close the browser, and revisited the website, that button will still be highlighted. It worked out well on my laptop. But when I sent out for testing to my 3 co-workers. Two of them were having problems with it. The other one has no problem at all.
Any suggestions? Thanks in advance.

It has to do with the timing when the sharedobject is saved.
In order for it to work properly, when you have set the sharedObject value it should be stored right away. You can do this by calling the flush() function from the SharedObject. This will make sure that it save right away instead of waiting to be saved in the queue.

Related

Userform multipage does not refresh

I'm working on a VBA application that consists of few pages on multipage.
I have a list of items on page 0 and when I click on that item, Excel should move to a different page.
The code:
Userform1.MultiPage1.Value = 1
This does not happen. Page 1 is not shown even though it is selected (tab on top of the multipage is selected).
I have quite a bit of code prior to above shown code and everything seems to be working.
I have read on Google that the problem could be due to declaring the same variable more than once. Code checked and looks ok now.
I also read that the form can be corrupted. I hope it isn't because there is a lot of stuff on it.
Any idea why the multipage doesn't change the page and how to fix it?
On attached picture you can see that the multipage has changed from 'page1' to 'video_exhibit', however it did not update the view. just stayed on the same page.
Multipage was working prior to this stage of the application.
I shared the files on Google drive at https://drive.google.com/drive/folders/12LTuaMoQ-HpI1z8g9F2419dHvHQU4f_4?usp=sharing
uploaded are: rar, zip and exports from app. userform and modules.
I'm aware there is lots to fix and unnecessary loops, but this can wait as I just need a draft working.
Thank you for your help.
So, after spending whole night trying to fix it, I decided to create new Userform and copy all the stuff on it. It works!
I've asked if the problem could be due to file being corrupted and it looks like this was the reason. Userform1 was behaving strangely and I could not understand it.
So unless someone will find different reason for the bug, the official version is - Userform1 was corrupted.

Liferay IPC listener runs multiple times

First of all sorry if this question has been already asked somewhere, but after a few hours on google I still can't find an answer.
I am pretty new in portlet development, (but we have a shortage of developers and I have to work with it time to time), so the solution might be something trivial, but I really don't have enough experience with it.
The problem is I have two portlets on a page and I try to let one of them know about changes in the other. For this I use IPC. In the first one I have a Liferay.fire function:
function fire(key,value){
Liferay.fire(
'category',{
id: key,
name: value
}
);
}
In the other I have a Liferay.on('category',function(category){...}) function with an ajax call inside and some rendering methods.
Now if I visit the mentioned page and click on the corresponding buttons, at first everything works just fine. However, if I navigate from this page and come back, the listener will run two times. Navigating again -> three times. And so on... But if I reload the page (with F5 or CTRL+F5), it starts over, so until further navigation the listener runs only once.
The other strange thing is no matter how many times the function runs, the input parameters are all the same for each.
For example, if I have left the page and went back to it 3 times and last time I chose the category with 'id=1', then the function will run 3 times with 'id=1'. Now if I choose 'id=2' it will run 3 times with 'id=2'.
If anyone has any idea I would be really grateful as I am stuck for almost a day now.
Thank you very much in advance and please let me know if you need any further info.
the problem you're having is caused by the global Liferay.on listeners that are being created but never removed.
In Liferay Portal 7.x, SPA navigation is enabled by default. This means that when you are navigating, the page isn't being completely refreshed, but simply updated with new data coming from the server.
In a traditional navigation scenario, every page refresh resets everything, so you don't have to be so careful about everything that's left behind. In an SPA scenario, however, global listeners such as Liferay.on or Liferay.after or body delegates can become problematic. Every time you're executing that code, you're adding yet another listener to the globally persisted Liferay object. The result is the observed multiple invocations of those listeners.
To fix it, you simply need to listen to the navigation event in order to detach your listeners like this:
var onCategory = function(event) {...};
var clearPortletHandlers = function(event) {
if (event.portletId === '<%= portletDisplay.getRootPortletId() %>') {
Liferay.detach('onCategoryHandler', onCategory);
Liferay.detach('destroyPortlet', clearPortletHandlers);
}
};
Liferay.on('category', onCategory);
Liferay.on('destroyPortlet', clearPortletHandlers);

CodedUI Keyboard.SendKeys() sends Keys Randomly

This was always working up until now...
I am testing a web Application and need to enter Users Name into HTMLEDIT control
KeyBoard.SendKeys(control,"Alice");
this enters Name as "AAAicce"
I am using VS2013,This was working fine with VS2010.
Please suggest what is going wrong here.
It happens when control is not in Focus. You can try clicking on control and then sending keys to make sure it goes to right control.
Have you tried setting the delay? For example:
Keyboard.SendKeysDelay = 1000; // 1-second delay between keystrokes

Controls not receiving messages after parent change

In my application there are a lots of dialogs being opened and closed all the time. The dialogs are non-modal.
In order to save some performace, we are "recycling" some of the more complicated controls. When one dialog is closed, the controls are not destroyed, but their pointers are stored in an array so that they can be reused when another dialog is opened.
The problem is that after the control is positioned in the new dialog, it does not receive all the messages. For instance the message WM_DRAWITEM (the control is derived from CListCtrl) is not being sent anymore. The WM_LBUTTONDOWN on the other hand is still arriving. It is as if the control does not know its class anymore. The NC area (border and list header) is being painted correctly.
Did anyone have similar problems? What could be wrong? Can the controls be "detached" and "reattached" in this way at all?
For CListCtrl to respond to WM_DRAWITEM image it is needed it has the LVS_OWNERDRAWFIXED style. Are you sure you have it set?
And from http://msdn.microsoft.com/en-us/library/windows/desktop/bb774739(v=vs.85).aspx , it seems it only occurs if it is in Report view (Seems strange to me!).

Requesting Advice with parallel programming and webrequest

Currently I have about 20 websites in a list box on my windows form that contain url's.
Each url will navigate to the website download a picture and place the picture into a picture box on the windows form
I have setup 4 picture boxes for the pictures to be entered into.
The user will see the picture of an animal and then will type in the picture and hit a submit button to send the result back to the website for confirmation.
My problem is that when I do try to implement a thread pool I don't have enough time to enter the name of the animal before the next picture loads.
Would it be better for me to create each thread manually and then toggle the button that submits the picture to the site to destroy the thread and grab the next one? I'm very confused. Any help would be awesome.
Thanks
you can use workers to do your background stuff, and a setinterval hack to simulate threads.
start throwing events, and move up the thread ladder when the event signifying completion is thrown.

Resources