On Thursday 03 November 2005 21:43, Lindsay Steele wrote:
> I think this is a pretty valid thread.     It would be good to know,
> that if action link is deprecated then what is the best way to send an
> object from page to page without having to expose the primary key.
>

Any news on that problem?

I also ran into this problem, but found mindbridges
FormLinkRenderer on t-deli.

The problem is that it 
a) gets a NPE.
(but you can easily change that, see below)
check for values == null
b) uses many deprecated methods.
I don't know if this will be somehow updated,
but it would be nice if something like this
would be included in 4.0.1



Now, if I could only get OSIV to work correctly...

best wishes
ido

private String generateFormFunction(String formName, ILink link, String 
anchor)
        {
                String[] parameterNames = link.getParameterNames();
                
                StringBuffer buf = new StringBuffer();
                buf.append("function prepare" + formName + "() {\n");

                buf.append("  var html = \"\";\n");
                buf.append("  html += \"<div style='position: absolute'>\";\n");
                
                String url = link.getURL(anchor, false);
                buf.append("  html += \"<form name='" + formName + "' 
method='post' 
action='" + url + "'>\";\n");

                for (int i = 0; i < parameterNames.length; i++) {
                        String parameter = parameterNames[i];
                        String[] values = link.getParameterValues(parameter);
                        if( values != null ){
                                for (int j = 0; j < values.length; j++) {
                                        String value = values[j];
                                        buf.append("  html += \"<input 
type='hidden' name='" + parameter + "' 
value='" + value + "'/>\";\n");
                                }
                        }
                }
                buf.append("  html += \"<\" + \"/form>\";\n");
                buf.append("  html += \"<\" + \"/div>\";\n");
                buf.append("  document.write(html);\n");
                buf.append("}\n");
                
                buf.append("prepare" + formName + "();\n\n");

                return buf.toString();
        }

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to