Question
Pegasystems Inc.
US
Last activity: 8 Sep 2017 9:47 EDT
Can we refresh UI components in section as user types in a text area?
For example,
We want to enable a button as user types in a text area. If user deletes the content, then the button should become disabled.
We tried both 'Change' & 'Any key' but could not achieve this behavior.
We achieved this behavior when user tabs out, but not as user types in text area.
Thanks for any feedback.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
US
Hello,
I had tried the use case in Pega 7.1.9 and its working as per your requirement as shown in the attachment.
Regards
Mahesh
Pegasystems Inc.
US
That worked for Text Input. Thanks.
But can you try the same with Text Area? It puts the cursor at position 0 each time typed.
Pegasystems Inc.
US
Hi Chow,
Yes it is expected behaviour with the TextArea field functionality, every time when we refresh the page the cursor position in the Text Area field will be set to starting position as expected that's the reason it is going to starting position.
I tried a way to set the cursor of the textarea back to the end position with a sample javascript code as shown in the attachment, but with this code also you can see the cursor goes to starting position then move to end position as both functionalities trigger on text area.
Code:
Hi Chow,
Yes it is expected behaviour with the TextArea field functionality, every time when we refresh the page the cursor position in the Text Area field will be set to starting position as expected that's the reason it is going to starting position.
I tried a way to set the cursor of the textarea back to the end position with a sample javascript code as shown in the attachment, but with this code also you can see the cursor goes to starting position then move to end position as both functionalities trigger on text area.
Code:
Hope this work around might help you.
Regards
Mahesh
Pegasystems Inc.
US
Hi CHOW,
I have tried your configuration for both Text Input and Text Area. Yes, it works for Text Input.
But for Text Area, if I use 'Any Key' event, the cursor is always at the position 0 when I type. If I change to use 'Change' event, button is not enable/disable when I type something or remove the content. It only works when the cursor is moved outside of the text area.
I would also to know how to fix this if there is a way.
Thanks,
Susan
Pegasystems Inc.
US
Thanks Susan. That is where i am also at. Text Area is not working as gracefully as in Text Input as you & I described above.
I wonder whether this is a bug in Pega7. Do you know if we can log this as a potential bug so that Pega Engineering can verify?
Pegasystems Inc.
US
If you are still not satisfied with my above workaround, you can go ahead to raise a BUG with us Chow so that our Engineering team can verify and fix it if its feasible. But for me this looks like an expected behavior coming from TextArea functionality.
Pegasystems Inc.
US
As the provided solution is not feasible, Chow raised a BUG-320375.
Optum
IN
Hi Mahesh/Chow,
Any update on the BUG-320375.
We have a requirement where when any text added in the text area the button "Submit" should get enabled and get disable when text removed.This is achieved using ANY KEY event but issue is the cursor move to the first.Please suggest
Pegasystems Inc.
IN
Hello!
The BUG has been resolved. The changes are scheduled to be reflected in the next product version release.
Regards,
Pegasystems Inc.
US
Hi CHOW,
I found out the below Support Article:
https://community.pega.com/support/support-articles/cursor-appended-extreme-end-left
The SR was logged for "Click" event with "Post Value" action. The issue was that "Cursor is appended to the extreme end on left" which is the same as yours.
Root cause: Invalid configuration; Resolution: Use "Change" event with "Post Value" action.
So, it seems that this is an expected behaviour with the TextArea.
Thanks,
Susan
Optum
IN
Hi,
Got the Workaround for this.On Any Key Event we are using setvalue action and mapping the same property value to associated property..
PFA the screen shots.
Pegasystems Inc.
US
Great, we will try it out!
Thanks for offering the work around.
Pegasystems Inc.
US
Archana - tried your usecase but dint work at my end, could you share the full configuration details.
Pegasystems Inc.
US
That work around also did not work for us. Can you share more details?
Optum
IN
Hi Chow/Mahesh,
Setting the associated value to the same property worked for me.If you guys are using SectionRefresh please remove it and kindly check in chrome.
Please revert back if it still doesn't work ,probably we can discuss.
Regards,
Archana Singh.
Pegasystems Inc.
US
Hi Archana,
Used setValue to initialize the property value with the associated property for Any Key and Change events on the text area field then added the condition to disable the button if property value is empty, but still the button is not getting enabled even though text is entered.
Regards
Mahesh