Field labels on repeated grids - Orbeon night-build - repeat

I'm new to both Orbeon and XForms and please forgive me for asking help on a version not yet released.
I am building an application that requires repeated blocks with multiple fields. The client wants to be able to use the form builder in the future to update the forms so manual xforms programming is out of question. At the moment I am using the night-built version of orbeon which supports repeatable grid, hoping that it will be included in the next release soon.
A problem I ran into is the lack of support of labels inside the grid. The forms builder does not allow input of lables to the fields. When I manually edit the source and put in the labels in the resources section, the labels are not visible except the first row of fields.
My first question is whether this is the intended behavior for the eventual release version? If so would it be possible to make it overridable by using a runner property?
Now the client is willing to accept some minor editing in the source code. Is there a simple way to make the (mnually input) labels visible? Some CSS code perhaps?
All information would be much appreciated.
regards,
Jeff

This is not the intended behavior. As you have noted the new builder is not yet in a stable version and the code is very much in flux at this time.
The idea is that if each repeated group of rows contains only one row, then the labels of the fields will appear as table headers. This is the behavior of the current Form Runner repeater. See for example:
Now if a repeated group contains more than one row, then the labels of the controls should probably be within the grid cells themselves, as it doesn't make sense to put the labels in table headers in this case. But note that this scenario is not implemented yet.

Related

Access closure property names in the content block at runtime

I want to evaluate my content blocks before running my test suite but the closures' property names is in bytecode already. I'm ooking for the cleanest solution (compared with parsing source manually).
Already tried solution outlined in this post (and I'd still wind up doing some RegEx/parsing) but could only get it to work via script execution engine. It failed in IDE and GroovyConsole. Rather than embedding a Groovy script in project's code, I thought I'd try using Geb's native classes.
Is building on the suggestion about extending Geb Navigators here viable for Geb's PageContentSupport class whose contentTemplates contain a LinkedHashMap of exactly what I need? If yes, would someone provide guidance? If no, any suggestions?
It is currently not possible to get hold of all content elements for a given page/module. Feel free to create an issue for this in Geb's bug tracker, but remember that all that Geb can provide is either a list of content element names or a map from these names to closures that create these elements.
Having that information isn't a generic solution to your problem because it's possible for content elements to take parameters and there are situations where your content elements will be available on the page only after some other actions are performed (for example you have to click on button to reveal a section of a page that uses ajax to retrieve it's content). So I'm afraid that simply going over all elements and checking if they don't throw any errors will not cut it.
I'm still struggling to see what would "evaluating" all content elements prior to running the suite buy you. Are you after verifying that your content elements still work to get a faster feedback than running the whole suite? I'm pretty sure that you won't be able to fully automate detection of content definitions that don't work anymore. In my view it will be more effort than it's worth.

Conditional check in Selenium IDE

I want to check whether a possibly mandatory field is filled in using selenium. I would very much prefer to do this using the IDE rather than exporting to code.
To be more specific, I want to make sure that a post code field is filled in if the value of the country drop down list is 'United Kingdom'. The post code field can be left blank if the drop down list is set to anything else.
If the consensus is that I have to export and do the test in code, then I will, but I would be a lot happier if I could sort this out just through the IDE.
Unfortunately, Selenium-IDE does not offer any flow control functionality by default. However, the Flow Control plugin introduces a few new commands - while, gotoIf, label and the ...andWait variants. Using these, you should be able to check the currently selected value in the dropdown menu, and jump past a verify command if the value is not "United Kingdom".
Fair warning; it's not the easiest thing in the world to work with. For anything beyond very basic flow control, you'd probably be better off exporting to code anyway. But, it's an option for when you really want to push the IDE!

Dynamic Magento Grid built with database query

This is my first time asking a question here so, be nice;p .. I'm working with Magento (and Zend Framework) for the first time and I'm trying to build a custom grid that will populate based off of a manually written query. I'm trying to extend the Mage_Core_Model_Mysql4_Collection_Abstract to allow a query to be loaded into it and then parse the select fields in the extended Grid class to make it dynamic... Is this even possible or am I beating a dead horse? I've been at it for a week now and I'm not getting anywhere. The problem seems to be that inside the __Model_mysql4_Collection class has to be initialized with a resource model using _init() in the constuct
As a learning exercise use the module creator to make an admin grid page and see how that is done. Or even modify it's output to get what you need.
There will be a grid container block, a grid block (with _prepareCollection and _prepareColumns methods), a model, a resource model (representing a single record) and a collection resource model (representing several records).
Providing your own _init methods shouldn't be any sort of problem. Perhaps you'd like to post your config.xml and code so far as a pastebin or something.

Is it possible to access custom properties from QT Designer after converting to python?

I am new to PyQt and Qt Designer and I'm trying to create an easy method for relating qWidgets with the tables and columns in an SQLite database. My idea was to tag each qWidget in designer with two custom properties, one with the table name and one with the column name. Later, I would use the info provided by designer to build my own class which creates a relationship between the qwidets and SQLite database.
Adding the custom properties in Designer seems to work fine however, the code for these custom properties do not get generated when converting the xml of designer into python (using UIC). Has anyone done this successfully? Perhaps there is a better way to do this?
Thanks,
Eric
If you added a property in Designer called "myproperty", fetch it with...
mywidget.property("myproperty")
This works fine in pyqt 4.8.3, perhaps it did not work in previous versions.
Check out this article Eric. Particularly look at the section titled "Producing a Plugin." River Bank Computing has another great PyQt reference.
EDIT:
I've been doing some more reading and I can't find a way to have this done automatically for you. If you are ok with with adding dynamic properties at run-time instead of design time you could accomplish the same end result. Here is an explanation of the setProperty() method in QObject, from which QWidget inherits.
If that doesn't work for you then it seems you might be better off going with a less generic approach. Instead of using a generic QWidget, you might be able to use a custom class derived from QSqlTableModel to keep track of your connection info. Another way would be to just use a QTableView and do the queries yourself to populate the data. Here and here are articles on databases in Qt. You might some inspiration for a new design from one of them.
I have not had great luck with using the Designer tool -- usually I end up doing a few rough layout, using pyuic and then editing and adding other stuff by hand.
It sounds like you could easily accomplish your task by creating your own custom class that inherits from QWidget and has the additional properties that you described. With my experiences trying to use custom widgets in the designer, I think the 'easier' way is to just write the class yourself and then set the layout by hand.
I know this doesn't exactly answer your question, but maybe you will try some of my suggestions.

Asynch GUI updates in Smalltalk

I wondered if anybody could help me with a technique to address the following problem in Smalltalk. Specifically Cincoms Visualworks.
I would like to code a simple GUI that has three fields and processes them as follows:
The first field inputs a number (5 say).
The second field simply displays twice the first field (so it displays 10 in this example)
Now, the interesting bit... the third field displays a value from a completely different class (let's call it class X). However, the value must be displayed on the GUI whenever that value in the class X changes - it mustn't wait for a key press from an update button. The value in class X could be sourced from (say) the workspace.
I though I could do this via aspect adaptors but I can’t seem to get the 'third field value' to update asynchronously.
Any techniques, hints or tips will be most warmly welcomed - (especially code snippets!!).
Thanks
Kevin
I've sorted this myself. After trying the dependency mechanism (works fine - but simply not needed), looking at announcements (thanks James at Cincom - personal communication) I found that all I needed to do was to simply create a method and send it a message with a parameter (my value) that method then simply updated the value holder (i.e. the aspect of the GUI field) with the "value:" message. The more I look into Smalltalk the more I like it!