Can a MonoTouch Dialog have no sections? - xamarin.ios

I'm trying to use MTD to make a table that's just a flat list of elements, but it looks like you can't add Elements to the RootElement; you have to have a child SectionElement and add Elements to it. But this makes a Section header in the table that MTD creates, even if the table view style is UITableViewStyle.Plain, and I don't want that header.
Is is possible to avoid having that header?

There should be no header visible if you use new Section (), otherwise you might have something else set in your DialogViewController.

Related

How do I add or rename $Comment property for xpage or custom control

In version 9.0.1fp4, when creating a new XPage or Custom Control you have the option of adding a comment. It then creates a Properties field, "$Comment" which is attached to the element. I can't find a way, using Designer, to modify that field after creating it. I'm pretty sure there's a programmatic way to get to the field, but I'm just looking for a simple way of changing. Rename will change the element name, but not give access to $Comment.
It's awkward, but you can edit it from the XPage or CC list. Position the cursor at the start of the non-demarcated Comments column (just below the left edge of the "C" in the header), click, and wait a few seconds.

What is the "for identifier" in a formRow good/used for?

The extension library offers means to structure your forms by Form Tables, where you can put Form Layout Columns and Form Layout Rows.
The Form Layout Rows have a property called "for" (the "For Indentifier") - here is the OnHover-text:
"Holds the ID of the control used to edit the data. That control should be contained within this Form Layout Row control."
So, I could enter the id of e.g. an Edit Box control I put into this form row (which translates to the code ' for="inputText1" '). But what exactly is this needed for? Where or for what can this information be used?
I found no different behaviour or limited functionality when sparing this information - at least, not how we use it atm. I found nothing in the web regarding this question; hope anyone can shed some light.
It's useful if your form row contains multiple controls, preventing the form row's code from determining its "for" target automatically. In that situation, you can provide the server-side ID of the "real" target control in the row to keep the label behavior working properly.
It's also mandatory to set this attribute if you want to use the built-in OneUI or Bootstrap themes to have the label formatted correctly. For example the text will be bold only if you set the for attribute (Bootstrap acts like this)

XPages: Repeat Control with Sections

i'm using a repeat control in my XPage which contains some repeated sections.
The titles/header of this sections are computed from a JSON String which is stored in a sessionScope variable. So far evrything works fine.
Now i have to expand/collapse one or more sections with a button outside the repeat control.
The button "knows" the title and the header of the section which have to be collapsed/expanded.
How can i get the right ID to use something like:
getComponent("XXXXXXX").setClosed(true);
Any Ideas?
You can achieve this in client side JavaScript. First you need to find the ID of section which contains your header text. For that you can use a simple dojo.query with selectors.
var sectionID = dojo.query(".xspSection:contains('<YOUR HEADER TEXT>')")[0].id;
This would search for all the sections on your page with your specified header text in it and return all the nodes. Assuming that your header is unique get the first node (that's why the [0]) and from it get the ID of section. Once you have the ID use the XSP object to show/hide section.
XSP.showSection(sectionID, [true|false]);

How to show header of ListView when its empty

I am developing the following screen
The fourboxes next to each other are buttons. On clicking of the buttons I am changing the adapter of the listview.
Since the content above the listview took up lot of space I made the whole thing as an header and added it via code.
myPollsList = (ListView) findViewById(R.id.listArea);
myPollsList.addHeaderView(getLayoutInflater().inflate(R.layout.profile_listview_header, null));
Now I want to show some view when the list is empty. But if I do that then the header also goes away.
I am using this in a Activity and not a ListActivity. Any suggestions or workarounds for showing the header even when the list is empty ?
EDIT: Refer to my earlier question here ListView not getting space to show content on smaller screens . This is where someone suggested me to solve the problem by putting it as a header
I found a simple solution for this problem. If there's no elements for list and you are not adding the adapter, just add this:
mListView.setAdapter(null);
and the header will appear. It's easier than adding empty / fake item to the list.
So this is how I solved it. I had a custom adapter which was connected to the listview. When it found that it had zero items to display. It would add a fake empty view as an item to the list.
maybe you will like this Android addHeaderView disappears when no items in ListView
override/subclass your adapter to return false from isEmpty()
Don't use top layouts of button as header for list view.
So to adjust UI without using list header use weights.
Give parent Linear layout weight sum as 4 and 1, 1 to top Layouts and 2 for list view.

Dynamically add / remove editable area to custom control embedded in XPage

Okay... this is a little difficult to explain but I will try my best.
In Custom Control while adding properties in Property Definition we can set "Allow multiple instances" which allows us to add multiple instances of that property when the control is embedded in XPage.
Similarly, I need to know whether it is possible to add (and remove) Editable Areas in a custom control when it is embedded in XPage? What I plan is that I would have a repeat control inside my custom control and I would be able to put the contents in each editable area in every loop of that repeat.
Is this the right way to go about or am I looking at this problem incorrectly? Any solution not involving editable areas is also welcome :)
Update 4 Apr 2013:
A use case context I am looking for is a simple carousel where contents of each screen in carousel can have different contents. These contents would be put into each (dynamically added) editable area. The contents can be very different from each other with one screen containing only text, other only image and another both image and text.
Look at the table walker example in the 26 original exercises. It does mostly what you are looking for (conceptually). You won't need multiple editable areas. Whatever is inside the repeat gets repeated.
What you want to do is to give the control a custom property "boolean editMode" so you can render that one line to be edited - if that's the UI pattern you want to follow.
You also could consider a dojo table with Ajax which allows for a familiar spreadsheet UI

Resources