What is the JavaScript event to use in lfWatch for page load ?

Hi,

I am learning to use JJUPIN Live Fields. I want a script to be run once a create screen is opened. My main script is like this:

 

lfWatch("summary", {"summary" "issueType"}, "test.sil", {"change"});

 

The problem i that this will only be called when the summary field is changed. instead, I want it to be called automatically once the screen is loaded with out the need for the user to do anything. I have tried many events instead of "change" like : "load" and "loadend" but it did not work. What is the event I should use for that?

Thanks.

1 answer

1 accepted

Hi Sadek,

 

I am assuming that you want to do something with summary and issueType when the page loads and you have argv["summary"] in test.sil.

 

You should use the test.sil directly as main Live Fields SIL script, with only one change: use summary and issueType instead of their argv[".."] version. Their values will be the field values from DB.

 

If you also want to get the live value from the screen(that might not be saved yet in DB, like on the edit screen), your current approach is correct.

 

Hope this helps,

Silviu

Thanks for the quick response! My case is the second one: I need to read the screen value of the issue type. I need to hide the summary field and pre-populate it with a value only if the issue type is xyz. The problem I am facing is that I could not call test.sil directly when the create screen is loaded. Some field has to change for that to happen. Is there an event that can do that for me? Sadek

Usually, for create screen you need lfInstantHook. You have some examples on Kepler documentation site.

Thanks. That is exactly what I need. The documentation page is here for reference: https://confluence.kepler-rominfo.com/display/JJUP30/lfInstantHook

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published yesterday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

60 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you