[pmwiki-users] input default not being generated
marc
gmane at auxbuss.com
Wed Jan 24 04:52:37 CST 2007
marc said...
> Patrick R. Michaud said...
> > On Tue, Jan 23, 2007 at 04:21:04PM -0000, marc wrote:
> > > When I hard-code the following:
> > >
> > > (:input default name=currency value=USD:)
> > > (:input select name=currency value=GBP:)
> > > (:input select name=currency value=USD:)
> > > (:input select name=currency value=EUR:)
> > >
> > > the expected option is selected. When I generate the dropdown via markup
> > > with, say:
> > >
> > > function currencySelect() {
> > > $out = "(:input default name=currency value=USD:)";
> > > $out .= "(:input select name=currency value=GBP:)";
> > > $out .= "(:input select name=currency value=USD:)";
> > > $out .= "(:input select name=currency value=EUR:)";
> > > return $out;
> > > }
> > >
> > > the 'selected' option is not generated (in HTML). I am using 'split' for
> > > the 'when' parameter.
> >
> > How/where is currencySelect() being called?
>
> As a directive
>
> (:currencySelect:)
>
> I'm testing in both the sidebar and a regular page (usually the
> Main.Sandbox). Ultimately, I plan on using it in the sidebar.
> >
> > You might need to use '<input-select' as the $when parameter,
> > since the (:input select:) markup rule occurs before split
> > (needed in order to be able to read multiple statements
> > across newlines).
>
> Okay, I'd not heard of <input-select, but that didn't change the
> behaviour. However, I'll stick with it hereafter.
>
> I don't know if this helps, but say I have (:currencySelect:) in the
> sidebar and Sandbox is empty. In this case, 'selected' is not generated
> for the sidebar dropdown.
>
> Now, if I add (:currencySelect:) to Sandbox, then the dropdown in the
> sidebar 'works' - i.e. 'selected; is generated - but the sandbox
> dropdown has no 'selected' generated.
>
> When I add a second (:currencySelect:) to Sandbox - the third being
> displayed, along with the one in the sidebar - then the sidebar dropdown
> works, and so does the latter of the two on the page.
>
> <p class='vspace'><select name='currency' class='inputbox'><option
> value='GBP'>GBP</option><option value='USD'>USD</option><option
> value='EUR'>EUR</option></select>
> </p>
> <p class='vspace'><select name='currency' class='inputbox'><option
> value='GBP'>GBP</option><option value='USD' selected='selected'>USD
> </option><option value='EUR'>EUR</option></select>
> </p>
Just another FYI. As a workaround I am using:
>>display=none<<
(:currencySelect currency=USD:)
>><<
(:currencySelect:)
All the initialisation occurs during the 'invisible' first call - a
session variable stores the current value, for example - and thereafter,
the HandleAction works okay (via the visible instance, clearly).
--
Cheers,
Marc
More information about the pmwiki-users
mailing list