PDA

View Full Version : Showing an edittext when datapath is missing


dave_1893
03-14-2009, 05:28 AM
Hi all,
I'm very new to laszlo and have the following question:

I have a form showing the details of a person with several edittext-elements (for the name, the street etc.) that look like this:


<edittext width="350" height="21" text_y="1">
<datapath xpath="@name"/>
</edittext>


Next to the form there's a list of persons - when you click on one name in the list, the form shows the data of the selected person (because I set the datapath of the form to the datapath of the list) and you can edit and save the data - that works.

I also want to use the same form for adding new persons. The problem is that the edittext-elements are not shown until a person was selected in the list / it is not shown as an empty form for adding new persons. I know that's because the datapath is set to "nothing".

Is there any possibility to show even the empty form when the datapath is missing?

Thanks a lot!

Regards
alex

Version: 4.2.0

hipik
03-14-2009, 07:09 AM
I didn't do much work on 4.2 but the old trick of setting datacontrolsvisibility="false" should do it.

Cheers.

Hipik ZM

senshi
03-14-2009, 08:44 AM
See Chapter 37. Data Access and Binding - 8.2. Forcing visibility of datamapped views (http://openlaszlo.org/lps4.2/docs/developers/databinding.html#d0e97214) for more information.

dave_1893
03-19-2009, 01:51 AM
Hi,
thanks a lot for your replies!

datacontrolsvisibility="false" has exactly the effect I wanted. But this way is depricated, I think.

Regarding the doc, the following is the preferred way I think:

visibility="visible"

Greetz
alex