getMessage in UI page not working

keepintouch_kir
Giga Contributor

HI Administration All,

I have modified OOB UI page "assessment_take2" as per user requirement. This was for adding custom translations for a message. Code is like below :

<j2:if test="$[GlideMobileExtensions.getDeviceType() == 'doctype']">

  <div class="notification notification-info">

  <j2:if test ="${task_table=='Incident'}">

       

                                                                        $[gs.getMessage('incident_survey_msg')]

            </j2:if>

  <a onClick="openTaskOverlay(event)" class="related-task-link">${gs.getMessage('${task_record}')}</a>

  <button data-dismiss="alert" class="btn btn-icon close icon-cross">

  <span class="sr-only">Close</span>

  </button>

  </div>

  </j2:if>

The above getMessage is not working for other languages except English after adding the   <j2:if test ="${task_table=='Incident'}"> condition. For english, message is showing up. I have added translations already in messgae table but it is not working Any help is highly appreciated!

11 REPLIES 11

snapps4
Giga Contributor

It seems like the if condition could be an issue "<j2:if test ="${task_table=='Incident'}">". It is phase 2 parsing you should use "<j2:if test ="$[task_table=='Incident']">


I tried this but no luck


preddy
Kilo Guru

Hi Kiranmai,


can you try the below code this is helpful for you..



<j:set var="jvar_target_table" value="${RP.getWindowProperties().get('target_table')}" />



<j:if test="${RP.getWindowProperties().get('target_table') == 'incident'}">


                      <p>${gs.getMessage('incident_survey_msg')}</p>


                </j:if>



PS: Hit like, Helpful or Correct depending on the impact of the response


comm.PNG


THanks   for your help but it is stiil not working. i guess the problem is having if under div dag. if i remove the if condition, it starts working for all languages. Else it works only for english.


comm1.PNG


Hi Kiran,



Hi. I am facing some issue regarding to message in UI Page.. For one specific user,   the above message "This survey is in regards ---"   is not   getting displayed. Any idea why is it happening?