Return a value from Store Binder (Bean Shell Form Binder) to HTML text box.

Confluence User - 26 Jan, 2018

How do I return a value from Store Binder (Bean Shell Form Binder) to a text box in HTML form?

I have tried the code below, but it is not working.

row.setProperty("textbox_id", "some value");

Thanks.

beanshell

9


27 Jan, 2018
confluenceUser
confluenceUser

You should be doing it in the load binder, not store.

29 Jan, 2018
confluenceUser
confluenceUser

Thanks for the reply. But, I would like to return the value to text box, after clicking the Submit button. Is it possible?

29 Jan, 2018
confluenceUser
confluenceUser

Maybe you can look at https://dev.joget.org/community/display/KBv6/Bean+Shell+Programming+Guide#BeanShellProgrammingGuide-UseasFormStoreBinder if (rows != null && !rows.isEmpty()) { //Get the submitted data FormRow row = rows.get(0); String unitPrice = row.getProperty("unitPrice"); String unit = row.getProperty("unit");

29 Jan, 2018
confluenceUser
confluenceUser

Thanks for the prompt reply. I have tried the code, but the value is only stored in database table, it is not return to text box.

31 Jan, 2018
confluenceUser
confluenceUser

Maybe you can share what you have developed, error that you have seen first so that we can better understand what you are trying to achieve. Store binder is to store, not to load value to textbox. After you press "submit" on a form, it will execute the store binder, if it is successful, then it will execute the load binder to load the latest set of form data back to the end user's screen.

01 Feb, 2018
confluenceUser
confluenceUser

I am trying to create a Search form. Users will key in an ID in text box 1, after they have clicked the Submit button, the matching Name will appears in text box 2. +---------------+ | Text box 1 | +---------------+ +---------------+ | Text box 2 | +---------------+ +----------+ | Submit | +----------+ Thanks again.

05 Feb, 2018
confluenceUser
confluenceUser

Hi there, do you mean that you coded the text box yourself in a Custom HTML element? You can retrieve the value saved into Joget by using form hash variable. Try #form.YourTableName.YourFieldID# https://dev.joget.org/community/display/KBv6/Hash+Variable Good luck!

05 Feb, 2018
confluenceUser
confluenceUser

Nope, the text box and button are from Joget. Still, thanks for the tips on the hash variable. Did you try to create a Search form with Joget before?

24 Sep, 2024
confluenceUser
confluenceUser

I have the same question. I have a form with a Bean Shell Form Store Binder code that executes a Sql Server external database stored procedure and returns a value (the SP runs an INSERT with the form fields as parameters and returns the newly created id). I want to show the returned value in some way in the UI

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print