cancel
Showing results for 
Search instead for 
Did you mean: 
michael_campbel
Nintex Newbie

Open specific panel from Nintex Workflow URL link

I have a Nintex form with five panels and at the bottom of each panel I have buttons (previous page, next page) with javascript.

In a Nintex Workflow Email Action, I have the URL to open the nintex form in edit mode but I need to this to open up on the first panel rather than the last panel.

Is the a command or setting I can add to the URL or Nintex Form to open in edit mode to a specific panel?

Tags (1)
0 Kudos
Reply
19 Replies
emha
Nintex Newbie

Re: Open specific panel from Nintex Workflow URL link

I guess you have some state variable within the form that controls which panel should be shown.

so you can define a default value for that variable, so that needed panel gets showed. if you need it, you can build simple if statement that sets different value for each of new/edit/view modes.

if you want to to control what panel to show via URL, you can append to it something like '&PanelToShow=1'

then you will get that value within form using inline function fn-GetQueryString('PanelToShow')

Reply
michael_campbel
Nintex Newbie

Re: Open specific panel from Nintex Workflow URL link

Could you give some more specific detail on how I do this....I'm a newby

Reply
emha
Nintex Newbie

Re: Open specific panel from Nintex Workflow URL link

can you post how does the rule(s) that controls single panels to show/hide look like?

Reply
michael_campbel
Nintex Newbie

Re: Open specific panel from Nintex Workflow URL link

I followed this post from the Nintex forum to set up the next/previous pages panels https://community.nintex.com/docs/DOC-1361

Reply
emha
Nintex Newbie

Re: Open specific panel from Nintex Workflow URL link

Michael, since you haven't posted your specific setup, I still might be too general.

I will follow naming from the post you linked. if you have customized it, you might need to adapt it according that.

in the linked post the main driving variable/control is hiddenTxtBox, so you will have to supply a (default) value for that control via URL.

in the linked post, control's default value is always set to 1, meaning first form/tab always  to be activated in New form.

however, (as you noticed) this doesn't have any effect on Edit form since in edit form default values are not populated.

to change that behavior you will need.

- post a default value via URL like: <URL you used up to now>&hiddenTxtBoxDefaultValue=12345

(replace 12345 with your chosen form/tab ID)

- populate control's default value with formula like

fn-If(fn-IsNullOrEmpty(fn-GetQueryString('hiddenTxtBoxDefaultValue')),1,fn-GetQueryString('hiddenTxtBoxDefaultValue'))

that will ensure to take over value from URL in New mode, if supplied, otherwise it  sets default value to 1

- to populate default value in Edit mode you will need this small javascript

NWF.FormFiller.Events.RegisterBeforeReady(function () { 
  if(Is Edit Mode) {
      var defaultValue = NWF.Utilities.GetQueryString(window.location)['hiddenTxtBoxDefaultValue'];
      if (defaultValue == undefined || defaultValue == ''){
         NWF$('#'+hiddenTxtBoxId).val('1');
      } else{
         NWF$('#'+hiddenTxtBoxId).val(defaultValue);
      }
  }
})

copy&paste that script to form's custom javascript.

make sure 'Is Edit Mode' is not copied as a plain text but rather replaced with reference.

Note hiddenTxtBoxId is javscript varable defined for hiddenTxtBox control.

Reply
michael_campbel
Nintex Newbie

Re: Open specific panel from Nintex Workflow URL link

Sorry, I will try to put as much detail as possible.

I have a Nintex form consisting of four panels. At the top of the form I have a series of  buttons

Against each panel I have a rule:

Using Nintex Workflow I send an email to a user with a link to this Nintex form, but I would like it to open on a specific panel, e.g. "Stage 2: Development".

Thanks

Reply
emha
Nintex Newbie

Re: Open specific panel from Nintex Workflow URL link

so your driving control/variable is 'Tabs'.

it should be equivalent to hiddenTxtBox control from the link and my post.

you haven't mentioned that and it's even not clear from your pictures, I just assume if you carefully followed provided link, it's (hidden) single line text control.

you haven't raised any question or problem in your post so I'm not sure what a problem you still might experience.

hopefully my post is clear enough to match it to your case now.

if not, raise specific questions you need to help with.

Reply
michael_campbel
Nintex Newbie

Re: Open specific panel from Nintex Workflow URL link

I have not even tried your solution as I am a bit confused about what needs to be done. In this example, I don't have a hiddenTxt box, I only have the

.

Q: Where to do I place the "populate control's default value with formula like " ...??

Q. How do I determine the Panels ID?

Reply
emha
Nintex Newbie

Re: Open specific panel from Nintex Workflow URL link

you have implemented it a bit differently comparing to link you have posted.

instead of (hidden) single line text control you hold current active panel in choice switch.

therefore it doesn't 100% fit to your case, and that's exactly  the reason why I asked you to post your specific setup at the very beginning...

the concept remains moreless the same, however, forcing value of choice switch buttons is a bit more  complex.

and the important point is, how you'd like resp. need to hand over choice value in URL.

you can hand over choice option text itself, which makes thing even more complicated, since you will have to take care f URL encoding/decoding of the passed text value at the both ends.

I would suggest to reference respective choice option by its position and I will provide a solution for that below.

so let's repeat adapted procedure once again:

- post a default value via URL like: <URL you used up to now>&panelSelectorButton=1

(replace "1" with your chosen button/panel positional reference - eg. 3 for 'stage 3')

- preserve setting of choice control's default value to static value as you have posted it on screenshot above (stage 1)

within the 'default value'  you will not be able to translate positional argument to option value

- to populate default value in Edit mode you will need this small javascript

 NWF.FormFiller.Events.RegisterAfterReady(function () { 
   if(Is Edit Mode) {
       var defaultValue = NWF.Utilities.GetQueryString(window.location)['panelSelectorButton'];
       if (isNaN(defaultValue))
          defaultValue = '1';
       NWF$('#'+varTabs).find('span:nth-of-type(' + defaultValue + ')').find('label').click();
     
   }
})


copy&paste that script to form's custom javascript.

make sure 'Is Edit Mode' is not copied as a plain text but rather replaced with reference.

Note varTabs is javscript variable defined for Tabs choice control (button)

Reply