cancel
Showing results for 
Search instead for 
Did you mean: 

Not allows to assign default value to input field using values in datastore

Former Member
0 Kudos

Hi Masters,

Consider that I have one input field in a form. I should assign default value to it. I should assign to it, the value which i have stored in a datastore. When i run the application, if i give default value as 123 ,then it is working fine i.e., it is showing 123 in the textfield in form , but if i give the default value as STORE@ProductId, then it is not displaying that value in the form.

Please help me out.

Thanks & Regards,

Kaushik Sreeram

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

i faced this problem and here's what i concluded:

There's no way you can set default value for input field dynamicly, since the default value of input control is caculated only once (i think on initializing of the iView). The input control and the data store are initialized at the same time, STORE@productID is empty that time...

If you don't need to recieve value through the input field you're trying to initialize, but just to display the value from the store - I suggest you try using another control - Expression Box. It's value is calculated continiously, just like the Label's, and you can refere to it later.

Regards,

Yulia

Former Member
0 Kudos

Hi Yulia,

Ya , I have tried using the expression box. It is displaying the value. Actually it is similar to label. I have already used label. Actually to my need it is just to display in the textfield. But as it has not worked, i went with the label. But this expression field looks effective than label, it looks similar to a text field which has been disabled.

Thank you yulia.

Regards,

Kaushik Sreeram

ashutosh_rastogi
Active Contributor
0 Kudos

Hello Kaushik,

I have never faced this kind of problem. Have you ensured that ProductId variable in DataStore is not empty.

Regards,

Ashutosh

Former Member
0 Kudos

Hi Ashutosh,

I have tried it again. I am able to display value in a store on the Label, but i am unable display it as a default value in the text field.

I have productId value as 200. I can view 200 on the Label.But in the text field i am viewing it as 0. If I give directly in the text field the default value "200" ,it is displaying as 200. If i give default value as STORE@ProductId ,it is showing as 0.

It is very important for me to solve that problem. Please help me.

Thanks & Regards,

kaushik

Former Member
0 Kudos

I am just guessing:

I think you have to refer to that label with the default value by using the labed-ID as prefix. You can see the label ID by clicking on this element and on the right bottom of the Configure Element pane you see something like REF: AFA50A. That's what you need to do (and I think it's the same problem that I describe in my book on page 361-362 for hierarchies).

The reference in your formula must look like: #ID[AFA50A]@ProductId

Let me know if that worked.

Former Member
0 Kudos

Hi Mario,

I have tried the way you have suggested,but it is not working. It is still displaying on the label, the value which is in the datastore.But if i try to assign the label's reference to text field's default value,then it is not displaying any thing.

The label and the textfield are on the same form. Even i tried to pick the value of the label on the previous form, even then it is not working properly.