41
Views
9
Comments
Solved
To check and compare the length of two column
Application Type
Traditional Web

Hi Folks

I am using TWA in which Data grid web is used.

Requirement is:  To check the length of one field and compare with another corresponding field value.

Example: I am having two fields in a grid i.e 

Column 1         Column 2

Column 1 value should always be greater than Column 2.

If I am entering "ABCD" in Column 1 then in column 2 I will not be  able to enter more than 3 alphabets.

I hope the requirement is clear.

Thanks in advance

2022-04-15 04-42-41
Tanisha Mahendru
Solution

Hi @Sourav Sandhu 

Just write down the Javascript. Example: TempColumn1 and TempColumn2 is there and need to compare the length,

then TempColumn1.length>TempColumn2.length && TempColumn1.length="" && TempColumn2=""&& TempColumn1=null && TempColumn2=null.

Apply these Conditions and let me know whether it will work for you or not.


Thanks,

UserImage.jpg
Sourav Sandhu

Thanks for the answer. It works.

2022-08-03 04-32-50
Ravi Punjwani

Hi Sourav,

Are you using TWA only for educational purpose or looking to solve any business app?

Usually with new projects, it is recommended to use Reactive Web for better utilisation of current technology, ease of use, optimized and efficient code.

You may find a workaround with this problem that you posted, but if it's a new project, I recommend not using Traditional Web at all. I see from your profile you've joined just a couple of weeks ago. Don't get me wrong if you're a seasonal user, or trying to fix any issue in an existing business app.

The problem you posted can be easily achieved on Reactive Web version of same forge component.

UserImage.jpg
Sourav Sandhu

Hi Ravi,

The app is already existing. Do you have a workaround/solution about the same as it will be helpful for me.

Thanks

2022-08-03 04-32-50
Ravi Punjwani

I think all you can do at this stage is to tag the correct forge component in your forums post. This will notify the team developing that forge component. So kindly edit and add the forge component on your forum post.

I believe @Gonçalo Martins would be the best person to help you on this issue. Hope you get this sorted soon, and have a clear pathway on migrating your apps on Reactive Web.

UserImage.jpg
Sourav Sandhu

What is the component for the above post?

UserImage.jpg
Sourav Sandhu

I am asking for the problem statement component. As you have mentioned in RWA the component is there so which component is this ?

2022-04-15 04-42-41
Tanisha Mahendru
Solution

Hi @Sourav Sandhu 

Just write down the Javascript. Example: TempColumn1 and TempColumn2 is there and need to compare the length,

then TempColumn1.length>TempColumn2.length && TempColumn1.length="" && TempColumn2=""&& TempColumn1=null && TempColumn2=null.

Apply these Conditions and let me know whether it will work for you or not.


Thanks,

UserImage.jpg
Sourav Sandhu

Thanks for the answer. It works.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.