cancel
Showing results for 
Search instead for 
Did you mean: 

Hide a row in the table.

Former Member
0 Kudos

Hi,

In my application, there is a table and an input form. I have bound the table and input fields in the form to the same context node. Now when I am validating the form, the input fields values are getting showed in the table.

I have to show the table row, only when all the validations are correct and the user got saved in the back end.

Is this correct design?

Since only one such column is getting showed in the row, can I go with an option to hide the row and still show the values in the input form.

Edited by: Tony on Feb 20, 2009 5:06 PM

Accepted Solutions (1)

Accepted Solutions (1)

former_member201361
Active Contributor
0 Kudos

HI Tony,

In my application, there is a table and an input form. I have bound the table and input fields in the form to the same context node. Now when I am validating the form, the input fields values are getting showed in the table.

I have to show the table row, only when all the validations are correct and the user got saved in the back end.

Is this correct design?

NO, After finishing the validations,it is better to show the Row. and if the validation fails then u need not show the row. so create a new Value Attribute and bound it to the input field and do the validation checks.

if the value satisfies the validation check, then update the value to the back end and copy the data to the table node.

Thanks and regards

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks!

Former Member
0 Kudos

Is it a good practice to save the context node in the view controller (am creating a user in the UME database) or do I always have to save in the component controller?

former_member197348
Active Contributor
0 Kudos

Hi Tony,

If the information is private to the view (e.g. related to view's properties visibility,enable) then we need to store in that particular view's context. If the information is global or independent of that view then we need to store the data in Controller's context. As you are working with UME database you should use controller's context in this case.

Regards,

Siva

pravesh_verma
Active Contributor
0 Kudos

Hi Tony,

I guess the way you are following will always give you wrong result. Reason being the same attribute and node binded to both input field and Table. This will behave as the way have told.. That means as soon as some value will be entered in th inpu field the table will get populated with the same attribute value.

I guess the reason is quite simple to understand. If the same attribute is binded to both UI elements (InputFiled and Table), then as soon as any of these value will be updated, same value will be shown in the other UI element.

To fix this issue you can follow this approach:

1) Create separate node or a attribute for the inputfield. And bind this attribute to the Inputfiled UI element.

2) Keep the binding of the table as it is.

3) As soon as user enter some value in the inout field and hit enter, fire a function or validation check which you were talking about. There is event for onEnter in inputfield. You can use the same.

4) If the validation succeds then save the value in the backend and create a new element of the table and copy the value of the attribute of input field to the Table attribute whichis binded to Table.

Following this way will definitely solve you issue. If you require any further help please let me know. However you can easily get the code for creation of the new element of the node which is binded to table. Even then if you require any help, please feel free to revert back.

Hope this helps you!!

Thanks and Regards

Pravesh

Former Member
0 Kudos

Thanks for replying guys.

Is it a good practice to save the context node in the view controller (am creating a user in the UME database) or do I always have to save in the component controller?