??? Spinbox w/reset in AdminPC

[xFv]

Well-known member
Does anybody know how to get the "reset" button working with spinbox through admin template?
I can get it working with this:
Code:
<input type="hidden" name="checkboxes[]" value="{$property.property_definition_id}" />
<xen:spinboxunit name="properties[{$property.property_definition_id}]" value="{$property.propertyValueScalar}" label="{$property.title}" min="1" max="1000" step="1" />
<xen:include template="style_property_unit_extra" />

But that isn't right as you can see here:
Capture2.webp

If I try and save it with this:
Code:
<input type="hidden" name="checkboxes[]" value="{$property.property_definition_id}" />
<xen:spinboxunit name="properties[{$property.property_definition_id}]" value="{$property.propertyValueScalar}" label="{$property.title}" min="1" max="1000" step="1" />
<xen:html><xen:include template="style_property_unit_extra"><xen:set var="$reset">{xen:phrase reset}</xen:set></xen:include></xen:html>

It Errors and doesn't save.
Any Help is much Appreciated!
 
I'm not sure why your second bit of code has added <xen:html> tags around the include. You wouldn't need that based on what I'm gathering from the rest of the context.
 
I'm not sure why your second bit of code has added <xen:html> tags around the include. You wouldn't need that based on what I'm gathering from the rest of the context.
Your right! But as you can see in the image above,the edit icon doesnt line up right. That code was taken from a admin template that had radio buttons. I am needing a spinbox and Without the below code, I do not get the edit icon in adminpc which I am trying to achieve. Any Ideas?
Code:
<xen:html><xen:include template="style_property_unit_extra"><xen:set var="$reset">{xen:phrase reset}</xen:set></xen:include></xen:html>

***EDIT***
I have figured it out with using a different admin template example. Thanx...
 
Last edited:
OK... New Issue.
How would I remove the Checkbox from this code while preserving the edit icon? I do not need it.
Code:
<input type="hidden" name="checkboxes[]" value="{$property.property_definition_id}" />
<xen:checkboxunit label="">  
    <xen:option name="_null_" selected="{$property.propertyValueScalar}"
        label="{$property.title}"
        title="{xen:if $debugMode, $property.property_name}">
        <xen:spinbox name="properties[{$property.property_definition_id}]" value="{$property.propertyValueScalar}"
            min="0" step="0.25" />
    </xen:option>
    <xen:explain>{$property.description}</xen:explain>
    <xen:html><xen:include template="style_property_unit_extra"><xen:set var="$reset">{xen:phrase reset}</xen:set></xen:include></xen:html>
</xen:checkboxunit>
 
Last edited:
You can't, at least if you're including the style_property_unit_extra template. That detects what actions are appropriate for a given property.
 
Ok is there another way to achieve this then? or how could I edit a admin template without it?
 
This does it
Code:
<xen:spinboxunit label="{$property.title}" name="properties[{$property.property_definition_id}]" value="{$property.propertyValueScalar}" min="1" max="1000" step="1">
    <xen:explain>{$property.description}</xen:explain>
    <xen:hint>{xen:if $debugMode, $property.property_name}</xen:hint>

    <xen:html>
        <xen:include template="style_property_unit_extra">
            <xen:set var="$reset">{xen:phrase reset}</xen:set>
        </xen:include>
    </xen:html>

</xen:spinboxunit>
 
Sorry, I misunderstood the checkbox you were referring to -- I thought you were talking about the reset checkbox (which comes along with the edit icon).
 
Sorry, I misunderstood the checkbox you were referring to -- I thought you were talking about the reset checkbox (which comes along with the edit icon).

LOL! I should have been more specific in the details. But the above code is exactly what I needed.
 
Back
Top Bottom