How to setvalue a field component in Web page

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
Taku Izumi
Posts: 15
Joined: Thu Dec 15, 2016 2:03 pm

How to setvalue a field component in Web page

Post by Taku Izumi » Thu Dec 15, 2016 2:51 pm

Hi,

In Form application, the following code is valid in order to set a value to a field component.

For Each(#Item) In(#Panel1.ComponentControls) Operation(*INSTANCE_OF #Prim_evef)
#ITEM.SetValue Value(*NULL)
Endfor


On the other hand, this code is invalid in Web page because the setvalue method is not allowed.

Is there a similar code which can use in Web page?

Regards,
Taku

dannyoorburg
Posts: 145
Joined: Mon Jan 04, 2016 9:50 am
Location: Australia

Re: How to setvalue a field component in Web page

Post by dannyoorburg » Thu Dec 15, 2016 3:20 pm

Hi Taku,

the generic SetValue is indeed not (yet) implemented on the Web.

That leaves you with

- either specifically naming the input fields you'd like to clear (I usually do it through a Group_By)

Code: Select all

Group_By Name(#InputFields) Fields(#STD_TEXT #STD_NUM)

Evtroutine Handling(#Button_ClearAll.Click)

#InputFields := *NULL

Endroutine
- or else, if you MUST go generic (I'd be interested to know why if you do), you could always re-instantiate the whole panel/reusable part, but that seems to me a bit of a sledge hammer approach.

Regards,
Danny

Taku Izumi
Posts: 15
Joined: Thu Dec 15, 2016 2:03 pm

Re: How to setvalue a field component in Web page

Post by Taku Izumi » Thu Dec 15, 2016 5:13 pm

Hi Danny,

Thank you for your reply.

Group_by is a simple approach.

I will use that.

Regards,
Taku

Post Reply