Fwd: Difficulties with Bootstrap and xmlns in forms

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Fwd: Difficulties with Bootstrap and xmlns in forms

John Preimonas-2
Screenshots filtered out, so here is some of the additional code:
eXide results:

<div class="form-group">
<label for="location" class="col-sm-2 control-label">Select T/O location:</label>
<div class="col-sm-10">
<select class="form-control" id="location">
<option selected="selected">Boonah</option>
<option>Byron Bay</option>
<option>Caboolture</option>
<option>Darling Downs</option>
<option>Kingaroy</option>
<option>Talgai</option>
<option>Warwick</option>
</select>
</div>
</div>

Page source output;
<div class="form-group"><label for="location" class="col-sm-2 control-label">Select T/O location:</label>
   <div class="col-sm-10"><select class="form-control" id="location">
         <option xmlns="" selected="selected">Boonah</option>
         <option xmlns="">Byron Bay</option>
         <option xmlns="">Caboolture</option>
         <option xmlns="">Darling Downs</option>
         <option xmlns="">Kingaroy</option>
         <option xmlns="">Talgai</option>
         <option xmlns="">Warwick</option></select>
     </div>
</div>



Hi again,
I think I have yet again struck the namespace issue in my Bootstrap/eXist form.

In my edit.xq I have set up some ‘select’s but the values are not coming through. Some of the code is as follows:


    <form class="form-horizontal" role="form" action="update.xq" method="post">
        <div class="panel-group">
            <div class="panel panel-success">
                <div class="panel-heading">
                    <br /> <br />
                    <h1>{ $title }<small> Flight: {$flight/*:serialNo/text()}</small></h1>
                </div>
                <div class="panel-body">
   …etc…

                    <div class="form-group">
                        <label for="location" class="col-sm-2 control-label">Select T/O location:</label>
                        <div class="col-sm-10">
                        <select class="form-control" id="location">
                        {gFn:locationsList($flight/*:location/text())}
                        </select>
                        </div>
                    </div>
…etc…

The call to gFn:locations() is:
declare function gFn:locationsList($activeItem as xs:string) {
for $locations in collection(  '/db/apps/gliding/modules/data' || '/locations')//location
order by $locations/Location
return
if ($locations/Location/text() = $activeItem)
then
<option selected="selected">{ $locations/*:Location/text() }</option>
else
<option>{ $locations/*:Location/text() }</option>
};




In eXide the result looks as I expect it to be (screenshot follows)

However, when I open it in my application, I get the following (another screenshot). All of my selects appear empty, but I very well know they are populated correctly. They are just not being displayed.


When I download the page information, everything again looks correct, except for the xmlns which comes up blank. And that, I guess, is where my problem once again seems to lie.


Or is it something else that I am missing?

Thanks for your help.
Regards,
John





------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Difficulties with Bootstrap and xmlns in forms

Adam Retter
Still not enough. Can you paste the entire HTML document code as received by the browser - e.g. View-Source

On 16 September 2015 at 11:51, John Preimonas <[hidden email]> wrote:
Screenshots filtered out, so here is some of the additional code:
eXide results:

<div class="form-group">
<label for="location" class="col-sm-2 control-label">Select T/O location:</label>
<div class="col-sm-10">
<select class="form-control" id="location">
<option selected="selected">Boonah</option>
<option>Byron Bay</option>
<option>Caboolture</option>
<option>Darling Downs</option>
<option>Kingaroy</option>
<option>Talgai</option>
<option>Warwick</option>
</select>
</div>
</div>

Page source output;
<div class="form-group"><label for="location" class="col-sm-2 control-label">Select T/O location:</label>
   <div class="col-sm-10"><select class="form-control" id="location">
         <option xmlns="" selected="selected">Boonah</option>
         <option xmlns="">Byron Bay</option>
         <option xmlns="">Caboolture</option>
         <option xmlns="">Darling Downs</option>
         <option xmlns="">Kingaroy</option>
         <option xmlns="">Talgai</option>
         <option xmlns="">Warwick</option></select>
     </div>
</div>



Hi again,
I think I have yet again struck the namespace issue in my Bootstrap/eXist form.

In my edit.xq I have set up some ‘select’s but the values are not coming through. Some of the code is as follows:


    <form class="form-horizontal" role="form" action="update.xq" method="post">
        <div class="panel-group">
            <div class="panel panel-success">
                <div class="panel-heading">
                    <br /> <br />
                    <h1>{ $title }<small> Flight: {$flight/*:serialNo/text()}</small></h1>
                </div>
                <div class="panel-body">
   …etc…

                    <div class="form-group">
                        <label for="location" class="col-sm-2 control-label">Select T/O location:</label>
                        <div class="col-sm-10">
                        <select class="form-control" id="location">
                        {gFn:locationsList($flight/*:location/text())}
                        </select>
                        </div>
                    </div>
…etc…

The call to gFn:locations() is:
declare function gFn:locationsList($activeItem as xs:string) {
for $locations in collection(  '/db/apps/gliding/modules/data' || '/locations')//location
order by $locations/Location
return
if ($locations/Location/text() = $activeItem)
then
<option selected="selected">{ $locations/*:Location/text() }</option>
else
<option>{ $locations/*:Location/text() }</option>
};




In eXide the result looks as I expect it to be (screenshot follows)

However, when I open it in my application, I get the following (another screenshot). All of my selects appear empty, but I very well know they are populated correctly. They are just not being displayed.


When I download the page information, everything again looks correct, except for the xmlns which comes up blank. And that, I guess, is where my problem once again seems to lie.


Or is it something else that I am missing?

Thanks for your help.
Regards,
John





------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open




--
Adam Retter

eXist Developer
{ United Kingdom }
[hidden email]
irc://irc.freenode.net/existdb

------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Difficulties with Bootstrap and xmlns in forms

Adam Retter
Okay so your XHTML is in the xhtml namespace http://www.w3.org/1999/xhtml.

You could modify your function to put your option elements into the same namespace and see if that helps you -


declare function gFn:locationsList($activeItem as xs:string) {
  for $locations in collection(  '/db/apps/gliding/modules/data' || '/locations')//location
  order by $locations/Location
  return
    if ($locations/Location/text() = $activeItem) then
      <option xmlns="http://www.w3.org/1999/xhtml" selected="selected">{ $locations/*:Location/text() }</option>
    else
      <option xmlns="http://www.w3.org/1999/xhtml">{ $locations/*:Location/text() }</option>
};

On 16 September 2015 at 11:55, Adam Retter <[hidden email]> wrote:
Still not enough. Can you paste the entire HTML document code as received by the browser - e.g. View-Source

On 16 September 2015 at 11:51, John Preimonas <[hidden email]> wrote:
Screenshots filtered out, so here is some of the additional code:
eXide results:

<div class="form-group">
<label for="location" class="col-sm-2 control-label">Select T/O location:</label>
<div class="col-sm-10">
<select class="form-control" id="location">
<option selected="selected">Boonah</option>
<option>Byron Bay</option>
<option>Caboolture</option>
<option>Darling Downs</option>
<option>Kingaroy</option>
<option>Talgai</option>
<option>Warwick</option>
</select>
</div>
</div>

Page source output;
<div class="form-group"><label for="location" class="col-sm-2 control-label">Select T/O location:</label>
   <div class="col-sm-10"><select class="form-control" id="location">
         <option xmlns="" selected="selected">Boonah</option>
         <option xmlns="">Byron Bay</option>
         <option xmlns="">Caboolture</option>
         <option xmlns="">Darling Downs</option>
         <option xmlns="">Kingaroy</option>
         <option xmlns="">Talgai</option>
         <option xmlns="">Warwick</option></select>
     </div>
</div>



Hi again,
I think I have yet again struck the namespace issue in my Bootstrap/eXist form.

In my edit.xq I have set up some ‘select’s but the values are not coming through. Some of the code is as follows:


    <form class="form-horizontal" role="form" action="update.xq" method="post">
        <div class="panel-group">
            <div class="panel panel-success">
                <div class="panel-heading">
                    <br /> <br />
                    <h1>{ $title }<small> Flight: {$flight/*:serialNo/text()}</small></h1>
                </div>
                <div class="panel-body">
   …etc…

                    <div class="form-group">
                        <label for="location" class="col-sm-2 control-label">Select T/O location:</label>
                        <div class="col-sm-10">
                        <select class="form-control" id="location">
                        {gFn:locationsList($flight/*:location/text())}
                        </select>
                        </div>
                    </div>
…etc…

The call to gFn:locations() is:
declare function gFn:locationsList($activeItem as xs:string) {
for $locations in collection(  '/db/apps/gliding/modules/data' || '/locations')//location
order by $locations/Location
return
if ($locations/Location/text() = $activeItem)
then
<option selected="selected">{ $locations/*:Location/text() }</option>
else
<option>{ $locations/*:Location/text() }</option>
};




In eXide the result looks as I expect it to be (screenshot follows)

However, when I open it in my application, I get the following (another screenshot). All of my selects appear empty, but I very well know they are populated correctly. They are just not being displayed.


When I download the page information, everything again looks correct, except for the xmlns which comes up blank. And that, I guess, is where my problem once again seems to lie.


Or is it something else that I am missing?

Thanks for your help.
Regards,
John





------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open




--
Adam Retter

eXist Developer
{ United Kingdom }
[hidden email]
irc://irc.freenode.net/existdb



--
Adam Retter

eXist Developer
{ United Kingdom }
[hidden email]
irc://irc.freenode.net/existdb

------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open