w
Posts: 0
Joined: Tue Mar 26, 2013 12:30 pm

checkbox group and checkbox item behaviour

Reposting here, because my last question was set as "answered", while it didn't answer what I needed.

Can somebody explain me clearly how to address checkboxes in Tiggzi, and what is the programmatic difference between the checkbox group and the checkbox item?

Especially with for example 1 checkbox, Tiggzi creates a checkbox group and a checkbox item.
On which elements do I have to call the methods? For example checkboxradio('refresh')? It seems to be different for val(), is(:checked), prop('checked')? And what about trigger('change') , this is all giving mixed results if applied to the checkbox group or the checkbox item.

1) If I use the checkbox "value change" event, this event is fired 2 times when I click the single checkbox. Is this standard behaviour?

2) Also, when checking the state of the checkbox in javascript, it is not working:

Tiggzi('chkItemFavoriet').prop('checked') gives UNDEFINED

and $('input[name="chkItemFavoriet"]').is(':checked') gives FALSE

my checkbox is named 'chkItemFavoriet'

3) This is what happens if I do the checking on the name of the control GROUP I defined in Tiggzi instead of the name of the checkbox item:

Tiggzi('chkFavoriet').prop('checked') : UNDEFINED $('input[name="chkFavoriet"]').is(':checked')): TRUE

Somebody agrees that this is inconsistent or strange behaviour?

That's why I was asking what Tiggzi is doing with the control group and individual checkboxes, from a programmatic point of view, because the checkbox checking and setting is unpredictable.

w
Posts: 0
Joined: Tue Mar 26, 2013 12:30 pm

checkbox group and checkbox item behaviour

When I check in the value change event of the checkbox item itself:

$(this).prop('checked') is giving the CORRECT state of the checkbox. So there it is working.

w
Posts: 0
Joined: Tue Mar 26, 2013 12:30 pm

checkbox group and checkbox item behaviour

I rechecked point 1 that I made in the 1st post, with a complete new page without dependencies, added a checkbox. And the value change event is effectively called 2 times. Is this the expected behaviour? Because it is something important to take into account.

w
Posts: 0
Joined: Tue Mar 26, 2013 12:30 pm

checkbox group and checkbox item behaviour

I checked by creating a complete new app in Appery:

  • I create 1 checkbox: I name the group 'chkGroup' and the item 'chkItem'

    When I check the state with alert(Appery('chkGroup').prop('checked')); or with alert(Appery('chkItem').prop('checked')); I get

    all the time UNDEFINED.

    Please help...

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

checkbox group and checkbox item behaviour

Hi,

I'll take a look and update.

w
Posts: 0
Joined: Tue Mar 26, 2013 12:30 pm

checkbox group and checkbox item behaviour

Can you also check this? : New project, 1 checkbox (controlgroup name is chkGroup, and the checkbox item name is chkItem) and 1 button.

In the click event of the button: Appery('chkItem').prop('checked', true).checkboxradio('refresh').trigger('change');

This gives me a " Error: cannot call methods on checkboxradio prior to initialization; attempted to call method 'refresh' @ http://appery.io/app/resources/previe..." in Firebug.

How can the checkboxradio not be initialized when it's a static checkbox, that is not dynamically created, and the click event is called after the page has long been loaded?

w
Posts: 0
Joined: Tue Mar 26, 2013 12:30 pm

checkbox group and checkbox item behaviour

It is really strange. Another checkbox that was working until this week with the same methods, is not working anymore.

Did firefox update something that has broken the jquery checkbox functionality?

EDIT: same problems in IE10

w
Posts: 0
Joined: Tue Mar 26, 2013 12:30 pm

checkbox group and checkbox item behaviour

Think I get a sense of why all this is so confusing. So in the Appery UI i created 1 checkbox. I named the group 'chkGroup' and the checkbox item 'chkItem'

This is the HTML created by Tiggzi:

precode<div data-role="fieldcontain" class=" mobilecheckboxgroup1" id="j_5" dsid="chkGroup">
<fieldset data-role="controlgroup">
<span dsid="chkItem" class="mobilecheckbox1">
<input type="checkbox" name="chkGroup" id="j_6" tabIndex="2" data-theme="a" value="Item 1"
&#47;>
<label id="j_6_label" for="j_6">
Item 1
<&#47;label>
<&#47;span>
/code/pre

So to summarize, this is what Appery makes from it:

chkGroup: is a div with dsid="chkGroup", containing the checkbox group.
But it is also the name of the html input itself!!
chkItem : is a span with dsid="chkItem"

So when I do Appery('chkGroup') , this is referring to every input checkbox of the group. When i do Appery('chkItem'), this is referring to a span

This is not the behaviour that i expected. I expected that I could address the individual checkbox with Appery('chkItem').

So the question: how to select 1 particular checkbox?

And what about the error" Error: cannot call methods on checkboxradio prior to initialization; " that I talked about 2 posts above?

w
Posts: 0
Joined: Tue Mar 26, 2013 12:30 pm

checkbox group and checkbox item behaviour

In Tiggzi it's even different:

precode<fieldset data-mini="true" data-role="controlgroup" class="ui-corner-all ui-controlgroup ui-controlgroup-vertical ui-mini"><div class="ui-controlgroup-controls">
<span class="mobilecheckbox2" dsid="chkItem">
<div class="ui-checkbox"><
input type="checkbox" value="Item 1" data-theme="b" tabindex="4" checked="checked" id="j_168" name="chkGroup">
&#46;&#46;&#46;

Code: Select all

                                         <&#47;span> 

                                     <&#47;div><&#47;fieldset>/code/pre
w
Posts: 0
Joined: Tue Mar 26, 2013 12:30 pm

checkbox group and checkbox item behaviour

Any update on this please? I already lost my entire morning due to this, I would like to do something productive in the afternoon.

Return to “Issues”