incompatible type passed in as a parameter created by loading a GUI component. - google-apps-script

I am having a problem with a UI that I am building in a Google Spreadsheet. I will First explain a little about how it works and than I will get to the problem. The UI is fairly simple program that connects to a SQL database, it allows users to create new records, Query, search, and render reports. I have created all the panels (eg the intro page, the create record) in the GUI builder. As the user navigates through the UI I swap out a Grid with the new panel that i want the user to see. For example on the intro page there is a create button when the user clicks the button the gird where there intro panel was is replaced by the create record panel. I have created two ways for the user query/search for data. The first way is to select a number range on the intro panel and click the Query button. This will than query the last 10 or so records into a GUI built Panel that I will call MainForm. The second way is to "search" for a job. On the intro page there is a search button when the user clicks with button it goes to a new page; the grid is switched to the search panel. On the new page/panel the user can put in some parameters to search for. After the user clicks the search button the program should load the search results into the MainForm in the same way as when you Query from the intro page. I have taken the whole function apart line by line, so i am sure that the issue has to do with loading the panel/Component. What i mean by that is these few lines of code.
var Component = app.loadComponent("MainForm");
var panel = app.createVerticalPanel().setSize("770px", "900px").add(Component);
app.getElementById("contentGrid").setWidget(0,0, panel);
But why would it load in one case, but not in another? Also it is not the method of loading the Component, rather it is the returning the panel/ Component.
To Summarize, When I load the Component with the query function it works, but when i load the Component in the search function I get and error: Incompatible type passed in as a parameter. Also I load the MainForm Component in two other functions as and it works most of the time, but some times I get the same error.

I think your approach is not ideal, load component is not supposed to be called multiple times. It would be far more efficient to get all your panels in the same compnent and play with visibility of each panel to show / hide them on demand. Each panel should be inserted in a vertical panel so that the "new panel" slips to its place when the "old one" hides.
An example of this approach is shown in this post to simulate tabs and could easily be adapted to your needs.
btw, this method is also very fast and responsive since the full UI is ready from the very beginning ;-)

Related

enable command button on form while in filterbyform mode

I'm trying to put a pair of command buttons onto a form to enable users to:
enter filter criteria, then
after they enter the criteria, apply the filter
The first is easy enough with "DoCmd.RunCommand acCmdFilterByForm"
The second would work with "DoCmd.RunCommand acCmdApplyFilterSort", except that I can't figure out how to activate my command button "cmdApplyFilter". The code "Me.cmdApplyFilter.Enabled = True" throws a runtime error.
I've looked at a lot of discussions, and it seems the only way to do this is by clicking on the ribbon or quick access toolbar. Does anyone know how to activate a command button on the form while in filter by form mode?
I'm pretty sure that what you're trying to achieve is not possible. The 'filter by form' view of the form looks to be a copy of your original form with only the input controls enabled to allow you to enter your filter criteria. If you think about it, it wouldn't make sense to allow full functionality. If you could activate buttons in this mode then you would theoretically be able to perform all sorts of actions that aren't appropriate in this context: add records, delete records, navigate through the records etc.
I suspect that the only way you will be able to get the functionality you want without using the ribbon bar buttons (what's wrong with the ribbon bar?) is to hand-roll your own filter form. Design a new form having controls to accept filter criteria and buttons to cancel or apply the filter. Sounds like a lot of hard work though to replicate functionality that's already built into Access out of the box.

Access 2013 Web App - Why when subview data isn't saved and try to navigate to next record, Access disables controls?

I have a List view (parent), and inside of that I have a sub view that is a blank view which contains some input boxes. I also have Next/Previous buttons in the parent that use GoToRecord to navigate to the next/previous records.
If I enter some data into the subview and try to navigate away using the Next/Previous buttons, I recieve an error asking me to Save, Discard or Edit my inputs in the subview (which is fine). However, if I:
click Save: It goes to the next record (expected) but the controls on the next record do not work
click Discard: Same as above - that is, it goes to the next record but none of the controls work
click Continue Editing: It jumps to the next record and populates the subview with the data from the previous record.
Why am I encountering these issues? Is this a product issue?
Yes, this seems to be a product issue. I believe this is essentially the same type of underlying product issue you identified in your earlier post here:
MS-Access 2013 Web Apps - Why does GoToRecord break when the view contains a subview?
I talked with the product team and they are looking into this. Access seems to be swallowing the custom Action Bar buttons in this scenario with a main and Subview.

SSRS PopUp Message Box

Ive had a request from a client to make a popup box appear on the click of a databar within an SSRS report. Not had any luck with various Google Searches and just wanted to know if anybody has either got this work directly or has any suggestions for a workaround they have used?
Bit of background on the actual report itself, it simply contains a table with various stacked DataBars showing comparable data between multiple users in a system. The ability is needed to click a bar and see which User that bar relates to.
Any suggestions are appreciated.
It's not quite the same thing, but you can use the SSRS tooltips functionality to achieve something similar, i.e. a user will hover over a part of a chart and some contextual text information will be displayed.
Show ToolTips on a Series has some further information.
You can add an action to an object with a javascript popup which can show a specific URL or another report. In the action click on Fx to set an expression as follows:
I used a different script to popup a URL which contains an image url from the database:
="javascript:void(window.open('" + Fields!ImageURL.Value + "', null, 'width=800, height=500, status=no, toolbar=no, menubar=no, location=no'))"
( you can replace Fields!Image.Value with a url , this is the URL from a database field)
a
On a PC this will showup properly sized as a popup. On an iPad it will appear as a new tab.

UiApp cache vertical panel

Developing small app to record a set of 6 readings for monitoring purposes in 31 rooms. App will have two main views, one view to show list of buttons for each room where readings will be taken, a second view where the values will be entered for a particular room and then posted to a spreadsheet.
The process in mind here is click on button for a particular room, enter the data, return to button view to choose another room to enter the data for that room and then back to button view screen.
Since the button view will seldom change do I have any options for caching this view so that I do not have to run a function to rebuild it each time. I have this function
function createTGSRoomListButtons(sh, aData){}
That takes the list of rooms and builds a panel of buttons for selecting the different rooms.
The question that I have can the above function be run once to cobble together the UI, cached and the later simply be 'recalled'?
TO that some end the view where the data will be entered can this be partially cached so that with each rendering a reference to a specific room can be made.
New to Google Apps Script so not really sure how to properly determine my answer.
You can have multiple panels in an UI and play with visibility to show one or another... no need to cache any content since they remain unchanged in the process.
If I understood your use case well, the panel with specific room info would be modified according to spreadsheet data so in this case you won't need to cache values since they would be "reconstructed" each time. The trick to show/hide panel has been shown in this post with clientHandlersand multiple panels in a unique vertical panel to ensure that the visible panel is always at the right place.
A very simple way would be build the UI for the first time and then hide/unhide the buttons' panel each time using the setVisible() method of the panel

Using a single shared element across multiple partial views

I have a basic ASP.Net MVC 3 application which has a number of controllers and a number of actions (and subsequently views)
A common feature of the application is to show a pop-up dialog window for basic user input. One of the key features of this dialog process is a faded mask that gets shown behind the dialog box.
Each of these dialog window controls is in a separate Partial View page.
Now, some view pages may use multiple dialog boxes, and therefore include multiple partial views in them - which as is would mean multiple instances of the "mask" element.
What I am trying to find a solution for is to only need to create one instance of a "mask" element regardless of the number of dialog partial views I include, and then the script in each partial dialog will have access to this element (so basically it just needs to be on the page somewhere)
The only real idea I have come up with so far is to add the "mask" element to the master page (or in the original view page) and this will mean it only gets added once. The problem here is that it will be added even when it is not needed (albeit one small single element)
I can live with this, but I would like to know if there is a better way to handle these kinds of scenarios?
A quick idea that came to mind is some kind of master page inheritance hierarchy, So I may have a DialogMasterPage that inherits from the standard current master page. How does that sound for an approach?
Thanks
To do something like this, where each module can register their need for a certain thing in the master page, you can use HttpContext to store a flag of whether you need to write the mask div, and just set that property in each partial. At the end of the master page, if the flag is set, you can then write the mask div if its set to true.
Obviously to make this cleaner you could wrap it all in an HtmlHelper extension or something.
My initial thought is for you to use something like jQuery UI where it handles the masking for you or if you are using something custom you can load the content for the dialog via ajax then show it in the single dialog on the master page.