dynamicPage(s) and href question


(Mike Maxwell) #1

I’m trying to create a dynamic page whos contents consist of href links of 1…n dynamic pages that are based on one page template.
Amazingly, that part works, I’m able to create multiple pages for data input, and generate the href links afterwords, as well as having a preferences map consisting of the data created by these pages, all of which are generated by one dynamic page template.

However, in order to re-populate the preferences from the page template when the href link is activated, i need to pass in some keys from the href link.
How do you do this?

Or is there another way to generate multiple dynamic pages based on a single page template, without defining a fixed number of these before hand…
Or another way, how do you pass parameters to a single dynamic page constructor such that you can re-populate the preference data at a later time?


(NotoiousBDG) #2

How to pass parameters in href?


(Mike Maxwell) #3

Jez, Yea exactly what I need. I should have figured someone ran into this before I did, never even tried searching for it, thanks.


(Mike M.) #4

Let me know if it works for you. I’m not having any luck.


(Jim Anderson) #5

@Mike_Maxwell do you have a code snippet you can share of it working?

We need some examples of using href in the preferences, and more documentation around it. It keeps coming up.


(Mike Maxwell) #6

Yea, nope…

            	 href(
                    name	: "${prefGroup.key}"
                    ,title	: "${prefGroup.value}" 
                    ,required	: false
                    ,page	: "group?yada=${prefGroup.key}"
                )

def group() {
	log.debug "yada:${yada}"
}

Just spin cycle like you, crap…


(Mike M.) #7

Try

def group(variables) {
    def yada = variables.yada
    log.debug "yada:${yada}"
}

(Mike Maxwell) #8

It works great against statically named dynamic pages where page: = the dynamic page method.
I think all of us are looking to have a template dynamic page, then pass in additional parameters so the previously generated preferences can load back in for editing…


(Mike M.) #9

@Jim, have there been any recent changes to how the page names in the href are being parsed? In the thread linked above, it seems like they managed to figure out how to pass parameters by using page: name?var=value[&var2=value[...]] and a corresponding def name(variables) in which variables is a map of the passed variables ([var:value, var2:value]).

But that was a month ago.


(Mike Maxwell) #10

The page method never gets called…


(Mike M.) #11

So, same results all around. I wonder if there’s some assumed information missing from the other thread, or a code change that makes it irrelevant.


(Mike Maxwell) #12

Dunno, I hope it’s missing (presumptive tribal knowledge), vs removal from the method.
Probably someone figured, why would anyone want to pass parameters to a dynamic page using HTML syntax…


(Mike M.) #13

My thoughts ran in the additive direction, like maybe they added a parameters map to make it cleaner. No, don’t ask what the name of that property is; you have to guess.

Speaking of which, anything not coming from an ST rep is just that, a guess.


(Jim Anderson) #14

@llamas I have a question out to our engineering team to see if something changed.


(Mike M.) #15

Thanks. And/or if they can just provide the how-to information.


(Mike Maxwell) #16

@Jim
If you manage to get this fixed, I’ll write a dynamic page example using it for you! :smile:


(Mike Maxwell) #17

@llamas, check this out…


(Mike Maxwell) #18

Still unresolved, my genius hack only works in the IDE not in the App, @Jim we still need some help on this one…


(Jim Anderson) #19

We are looking into it - hope to have some more firm guidance on this by the end of today if all goes well.