1
0
-1

I installed the simple employee management app in the market place.

https://marketplace.joget.org/jw/web/userview/mp/mpp/_/vad?id=APP_jemployee-v1

And when I edit an employee there is the employee ID in the URL

http://joget.server.expample:9090/jw/web/userview/jemployee/hr/_/maemre?_mode=edit&_action=submit&id=570dcb2e-7f001010-43929146-72a16a3b&OWASP_CSRFTOKEN=28JG-OOAG-K6EZ-1VER-G0J2-P7X8-ISWL-VIMU

Based on these:

Syntax to use in Extra Filter Condition field

Form Data Binder

Userview Key

 

On a select box, how can I add Extra filter condition to display only assets entry for example of the selected employee? Not all of them.

The variable is in the URL. I tried these but they don't work

e.customProperties.AppId LIKE '#request.header.id#'

e.customProperties.AppId LIKE #request.header.id#

e.customProperties.AppId LIKE #variable.id#

 

If I do

e.customProperties.AppId LIKE '%570dcb2e-7f001010-43929146-72a16a3b%'

I have the choice I want from the selectbox! Not the list with the entry from all the employee.

Any inputs would be appreciated.

    CommentAdd your comment...

    4 answers

    1.  
      1
      0
      -1

      That work! Thanks Matthew.

      That's with url variable comparaison but let say I want to compare with another fild in the same form?

      Let's say I have Form A. and there is a selectbox with the extra filter that we talked.

      e.customProperties.client_ref =  '#requestParam.assetId#'  Here it is compared wirl assetid in the URL

      But If there is a text box on the form #asset_reference# that as a default value from database : #form.j_personnel.id# how can I compare the two?

       

      I tried  e.customProperties.client_ref = #form.j_personnel.id# but doesn't work!

      how can I compare the two like e.customProperties.client_ref = #asset_reference# ?

       

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Hi Peter

        I think the hash variables does not work in the following areas due to its complexity:

        1. AJAX Subform and
        2. Double (or triple) nested Form Grids

        It is hard for me to suggest an exact solution for you as I am not able to see your app.

        However, maybe you can try some of the following options:

        1. Simplify your app, (smile)
        2. Use a hidden field to store the value of '#requestParam.assetId#' in your primary form and use this value in a later form (as in 2nd activity form, for example, in other words, splitting your data entry screens into 2 or more forms), or
        3. Use Joget's Multi Page Form feature to break your embedded forms into tabs. If you enable the 'Partially store form when page changed' option, you can be assured the previous tab field values has been saved into the database and you can retrieve them using the #form.table.field# hash or reference that stored fieldId in other elements (i.e. Select box grouping).

         

          CommentAdd your comment...
        1.  
          1
          0
          -1

          Thanks Matthew! It work for the first form grid but not the second!

           

          I have a form grid that calls a sub form where I use the '#requestParam.assetId#' and like I said it's working. I can use the filter condition. The thing is that in that form I call another form grid but in that second call the filter condition doesn't work!

          It's like this:

           

          Form A with one form grid that call a form B witch contain a select box. The extra filter condition with the '#requestParam.assetId#' works!

          In the form B I have another form grid that call form C with a selectbox ( it's a copy from form B). The extra filter condition with the '#requestParam.assetId#' DOESN'T WORK  here!  

          What am I doing wrong? Do you know why that is not working?

          Is there a solution or another way for doing this?

            CommentAdd your comment...
          1.  
            1
            0
            -1

            Hi Peter

            Please try this instead (smile)

            e.customProperties.AppId LIKE '#requestParam.assetId#'

            where your URL will look something like this ".....maemre?id=employeeIdValue&assetId=assetValue"

            Joget will search the url to find the 'assetId' value and pass it to your select customProperties.

            The #request# hash is actually to retrieve the current HttpServletRequest object of the page view.

            More information on Hash Variable Request Param available at Knowledge Base.

              CommentAdd your comment...