unplugged / unplugged-controls

7 stars 9 forks source link

iOS Partial Refresh #398

Closed grantnorman closed 10 years ago

grantnorman commented 10 years ago

Edited email from a customer:

"Be aware that we are new to xpages so that might account for some of the problems.

We have tested on ipad and iphone running IOS 7 and the up to date unplugged app from the store.

We have also tested this on the pc simulator and it works just fine.

The problem is we need to have a control that can run server side scripts and partial refresh itself and/or other controls.

After doing experiments, we have found that you can only partial refresh divs and divs cannot have server side scripts onclick."

I have an nsf from the customer, if required

grantnorman commented 10 years ago

Apologies if some of the context is lost as this was resolved over a number of emails, but the best summary is below:

"You are correct that partial refresh will not change a xp:button label but I am a little concerned as to why you would want to do this?

I would not recommend this pattern as this could become a maintenance issue! (I do not know your app so there are exceptions to the rule) I would recommend having the partial refresh update a container div (xp:panel) and then within the div have buttons labeled appropriately that do specific things and use rendered property (hide/when) triggered by the sessionScope entry. These will then be updated and also your code will reflect that each button does a specific job.

If you do absolutely need to do this then you can use our controls and use something like:

/xp:text /xp:panel This would then render a green button and the label would be updated. I see this is what you have done on line 140. The difference I would make here is that I would call a headless XPage (referred to as an XAgent these days), via AJAX, that has a beforeRenderResponse function that performs server side tasks, effectively doing the Partial Refresh manually. I have found this to execute faster that the 'official' Partial Refresh in Unplugged giving the user a better/faster experience. From you early emails I would state that what you require is doable - a list of docs that could be selected to be edited and elements partially refreshed when completed. One comment on this is that this method gets very ugly if there is a lot of data and a lot of records in one list. My suggestion would be to either use a UnpFlatView to show the summary data and then a UnpFormEditor to present the user with the data to be edited (this can be a split view on a tablet - list on the left, or top, and data on the right, or bottom). Or to use a UnpTabbedFooter control to segment the data by sections (depending on how much there is) so the user can more efficiently edit the data required. Again, I have not seen the app or original Notes design so I may be over-complicating things here. I am available to screen share and see what you have/what you want and make some suggestions."