Jump to content
UBot Underground

Problems with jquery mobile and ui html panel


Recommended Posts

when I put the word in a variable checkbox, checkbox did not check there is a problem with the word variable. anyone have a solution please?

my script is :

ui html panel("<!DOCTYPE html> 
<html>
<head>
    <title>Page Title</title>
    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">
    <link rel=\"stylesheet\" href=\"http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css\" />
    <script src=\"http://code.jquery.com/jquery-1.9.1.min.js\"></script>
    <script src=\"http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js\"></script>

</head>

<body>

<div data-role=\"name2\" id=\"toto\">

<fieldset data-role=\"controlgroup\" data-type=\"horizontal\" data-mini=\"true\">
    <legend>Taille de l\'entreprise</legend>
<input name=\"TailleEntreprise1\" id=\"TailleEntreprise1\" type=\"checkbox\" variable=\"#myvar15\" fillwith=\"checked\">
<label for=\"TailleEntreprise1\" checked>No choice</label>
<input name=\"TailleEntreprise2\" id=\"TailleEntreprise2\" type=\"checkbox\">
<label for=\"TailleEntreprise2\" checked>1-10</label>

</fieldset>

</div>
</body>
</html>

 

 

 

 

Link to post
Share on other sites

thanks for your response i need both versions of jquery loaded. when i try to move script parts bellow last div/before </body> tag.

it's the same thing. the full code is :

ui html panel("<html>
<head>
    <title>Page Title</title>
    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">
    <link rel=\"stylesheet\" href=\"http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css\" />
    <script src=\"http://code.jquery.com/jquery-1.9.1.min.js\"></script>
    <script src=\"http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js\"></script>

</head>

<body>

<div data-role=\"name2\" id=\"toto\">

<fieldset data-role=\"controlgroup\" data-type=\"horizontal\" data-mini=\"true\">
    <legend>Taille de l\'entreprise</legend>
<input name=\"TailleEntreprise1\" id=\"TailleEntreprise1\" type=\"checkbox\" variable=\"#myvar15\" fillwith=\"checked\">
<label for=\"TailleEntreprise1\" checked>No choice</label>
<input name=\"TailleEntreprise2\" id=\"TailleEntreprise2\" type=\"checkbox\">
<label for=\"TailleEntreprise2\" checked>1-10</label>

</fieldset>

</div>

</body>
</html>", 400)

i have the same problems when i want to check this checkbox i have nothing (sorry for my english).

Link to post
Share on other sites

Well you didn't move scripts bellow.

 

Try this:

ui html panel("<html>
<head>
    <title>Page Title</title>
    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">
    <link rel=\"stylesheet\" href=\"http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css\" />

</head>

<body>

<div data-role=\"name2\" id=\"toto\">

<fieldset data-role=\"controlgroup\" data-type=\"horizontal\" data-mini=\"true\">
    <legend>Taille de l\'entreprise</legend>
<input name=\"TailleEntreprise1\" id=\"TailleEntreprise1\" type=\"checkbox\" variable=\"#myvar15\" fillwith=\"checked\">
<label for=\"TailleEntreprise1\" checked>No choice</label>
<input name=\"TailleEntreprise2\" id=\"TailleEntreprise2\" type=\"checkbox\">
<label for=\"TailleEntreprise2\" checked>1-10</label>

</fieldset>

</div>
    <script src=\"http://code.jquery.com/jquery-1.9.1.min.js\"></script>
    <script src=\"http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js\"></script>
</body>
</html>", 400)


Link to post
Share on other sites

thanks in your code you have problems with links of jquery and css :

<link rel=\"stylesheet\" href=\"http://code.jquery.c...-1.3.2.min.css\" />

<script src=\"http://code.jquery.c...y-1.9.1.min.js\"></script>
<script src=\"http://code.jquery.c...e-1.3.2.min.js\"></script>

try with the complete links and you see my problem :

http: // code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css

http: //code.jquery.com/jquery-1.9.1.min.js

http: //code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js%5C

Link to post
Share on other sites

thanks in your code you have problems with links of jquery and css :

<link rel=\"stylesheet\" href=\"http://code.jquery.c...-1.3.2.min.css\" />

<script src=\"http://code.jquery.c...y-1.9.1.min.js\"></script>

<script src=\"http://code.jquery.c...e-1.3.2.min.js\"></script>

try with the complete links and you see my problem :

http: // code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css

http: //code.jquery.com/jquery-1.9.1.min.js

http: //code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js%5C

Sorry, I didn't notice that, I just copy pasted your code....next time please put code inside CODE element on the forum, so that links don't get shortened and we can copy paste them/code.

 

However, I updated the code above so it uses the right URLs and UI still works here....http://screencast.com/t/YIjLBrpWeP

Link to post
Share on other sites

sorry for my later response my files ubot it's here : http://www.screencast.com/t/xNmqPIj3s ..

sorry when i paste link you have space between http: and // and for this we dont have the same things

http: // code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css, it's my fault sorry and thanks a lot for your help

Link to post
Share on other sites

I was finally able to re-create problems you are having there, and I don't think this looks promising.

 

It looks like UBot variable is frozen at initial value and variable won't get updated once the user clicks the "checkbox" (also UI will force rendering of initial state).

 

Usually such problems are solved  by moving script at the bottom of the UI HTML, but in this case it looks like JQuery messes up with UBot code for UI, so I don't think easy solution exists for this.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...