<div dir="ltr">Hey Andreas,<div><br></div><div>Just to add to Denis's code example.  You can also use:</div><div><br></div><div style>d = iface.getFeatureForm(layer,feature)</div><div style>...some other code..</div><div style>

d.exec_()</div><div style><br></div><div style>which means you can get the dialog without opening it and open it later.</div><div style><br></div><div style>- Nathan</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">

On Wed, Jun 5, 2013 at 1:06 AM, Andreas Neumann <span dir="ltr"><<a href="mailto:a.neumann@carto.net" target="_blank">a.neumann@carto.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi Denis,<br>
<br>
Thanks - this should help me to implement it.<br>
<br>
Andreas<br>
<br>
Am 04.06.2013 16:57, schrieb Denis Rouzaud:<br>
<div class="HOEnZb"><div class="h5">> Hi ,<br>
><br>
> I did not test, but adding a python action to the layer B should work:<br>
><br>
> layerA = QgsMapLayerRegistry.instance().mapLayer("layerAid")<br>
><br>
> featureAid = [% "layerAid_column_name" %]<br>
><br>
> f = QgsFeature()<br>
><br>
> layerA.getFeatures(QgsFeatureRequest().setFilterFid(featureAid)).nextFeature(f)<br>
><br>
><br>
> iface.openFeatureForm(layerA, f)<br>
><br>
><br>
> If the layerA has no geometry, you might need to add NoGeometry as a<br>
> flag to the feature request.<br>
><br>
> Also, you might need to test if f is found.<br>
><br>
> Cheers,<br>
><br>
> Denis<br>
><br>
><br>
><br>
> On 06/04/2013 04:44 PM, Andreas Neumann wrote:<br>
>> Hi,<br>
>><br>
>> I have two tables with a 1:n to relation from table A to B.<br>
>><br>
>> In the form of table "B" I want to display a button that opens the<br>
>> corresponding record in a form of table A (in a separate window).<br>
>><br>
>> I know that Matthias Kuhn is working on such functionality for QGIS 2.1<br>
>> - but I would need a script-based solution now - this project cannot<br>
>> wait for QGIS 2.1<br>
>><br>
>> Does someone have a python script that does something like that or<br>
>> similar things?<br>
>><br>
>> The idea is to have a Python action with a few lines of code that does<br>
>> this and can be associated to a button.<br>
>><br>
>> Thanks,<br>
>> Andreas<br>
>> _______________________________________________<br>
>> Qgis-developer mailing list<br>
>> <a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
>> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
><br>
><br>
<br>
_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</div></div></blockquote></div><br></div>