Why doesn't this XML disable my joomla radio button? - joomla

<field name="name" type="radio"
class="btn-group"
label="label"
description="description"
default="0"
disabled = "true"
filter="raw">
<option value="0">No</option>
<option value="1">Yes</option>
</field>
How are you disable radio button with xml ?

One thing is that the disabled feature only works on option level, not for the whole field.
So you would need to set it like this:
<field name="name" type="radio"
class="btn-group"
label="label"
description="description"
default="0"
filter="raw">
<option value="0" disabled="true">No</option>
<option value="1" disabled="true">Yes</option>
</field>
However it doesn't work well together with the btn-group class. This is probably a Bootstrap bug.

Related

Does vee-validate work with third-party UI components, e.g. of Primevue?

I am using vee-validate v4.0, vue's (v3) components with TypeScript and UI components from Primevue and Ionic. Validation on simple input fields works fine:
<template>
...
<Field
v-slot="{ field }"
v-model="username"
:rules="isRequired"
name="username"
>
<IonInput
v-bind="field"
type="text"
/>
</Field>
<ErrorMessage
name="username"
class="error"
/>
...
</template>
<script lang="ts">
...
methods: {
isRequired (value: string) {
if (!value) {
return 'This field is required'
}
return true
}
}
...
</script>
Applying the same to Primevue's Dropdown element fails:
<Field
v-slot="{ field }"
v-model="campaign"
name="campaign"
:rules="isRequired"
>
<Dropdown
:options="campaigns"
option-value="id"
option-label="name"
placeholder="Choose a campaign"
v-bind="field"
/>
</Field>
<ErrorMessage
name="campaign"
class="error"
/>
Validation works as expected, but opening the Dropdown leads to error messages:
Do you know how this can be solved? Is there an example how vee-validate works with more complex fields like dropdown or multiselect elements?
This can be solved by listening on the input/change events and passing data between <Field> and (in this special case Primevue's) <Dropdown> as follows:
<Form v-slot="{ errors }" #submit="saveAndProceed()">
...
<Field
v-slot="{ field }"
v-model="campaign"
name="campaign"
value="value"
:rules="isRequired"
>
<Dropdown
:options="campaigns"
option-value="id"
option-label="name"
placeholder="Choose a campaign"
:model-value="field.value"
:class="{ 'p-invalid': errors.campaign }"
#input="field.onInput.forEach((fn) => fn($event.value))"
#change="field.onChange.forEach((fn) => fn($event.value))"
/>
<ErrorMessage
name="campaign"
class="error"
/>
</Field>
...
</Form>
Compare also with the following references for other events (onBlur etc.):
Vee-validate's Field reference
E.g., Primevue's Dropdown events
You need to add #update:modelValue="handleChange" to your dropdown:
<Field
v-slot="{ field, handleChange }"
v-model="campaign"
name="campaign"
:rules="isRequired"
>
<Dropdown
:options="campaigns"
option-value="id"
option-label="name"
placeholder="Choose a campaign"
v-bind="field"
#update:modelValue="handleChange"
/>
</Field>
<ErrorMessage
name="campaign"
class="error"
/>
<div class="col-6">
<Field
v-slot="{ field,handleChange }"
v-model="brand_name"
name="brand_name"
>
<div class="p-col-6">
<div class="p-inputgroup">
<Dropdown
:options="brands"
optionLabel="name"
optionValue="code"
:model-value="field.value"
placeholder="Select car brand"
#update:modelValue="handleChange"
/>
</div>
</div>
</Field>
</div>

geoserver returns black image on aerials

I am trying to upload aerial photos to geoserver to be shown as background. But everytime the image is black instead of detailed satellite image. Also tried on single tif files, but same result. Anybody have experience with this issue and know a solution?
I use ImageMosaic as plugin to upload the tifs.
This is the result of gdalinfo:
C:\Program Files\QGIS 3.8\bin>gdalinfo --format GTIFF D:\tile-20000-380000.tif
Format Details:
Short Name: GTiff
Long Name: GeoTIFF
Supports: Raster
Extensions: tif tiff
Mime Type: image/tiff
Help Topic: frmt_gtiff.html
Supports: Subdatasets
Supports: Open() - Open existing dataset.
Supports: Create() - Create writable dataset.
Supports: CreateCopy() - Create dataset by copying another.
Supports: Virtual IO - eg. /vsimem/
Creation Datatypes: Byte UInt16 Int16 UInt32 Int32 Float32 Float64 CInt16 CInt32 CFloat32 CFloat64
<CreationOptionList>
<Option name="COMPRESS" type="string-select">
<Value>NONE</Value>
<Value>LZW</Value>
<Value>PACKBITS</Value>
<Value>JPEG</Value>
<Value>CCITTRLE</Value>
<Value>CCITTFAX3</Value>
<Value>CCITTFAX4</Value>
<Value>DEFLATE</Value>
<Value>LZMA</Value>
<Value>ZSTD</Value>
<Value>WEBP</Value>
<Value>LERC</Value>
<Value>LERC_DEFLATE</Value>
<Value>LERC_ZSTD</Value>
</Option>
<Option name="PREDICTOR" type="int" description="Predictor Type (1=default, 2=horizontal differencing, 3=floating point prediction)" />
<Option name="DISCARD_LSB" type="string" description="Number of least-significant bits to set to clear as a single value or comma-separated list of values for per-band values" />
<Option name="JPEG_QUALITY" type="int" description="JPEG quality 1-100" default="75" />
<Option name="JPEGTABLESMODE" type="int" description="Content of JPEGTABLES tag. 0=no JPEGTABLES tag, 1=Quantization tables only, 2=Huffman tables only, 3=Both" default="1" />
<Option name="ZLEVEL" type="int" description="DEFLATE compression level 1-9" default="6" />
<Option name="LZMA_PRESET" type="int" description="LZMA compression level 0(fast)-9(slow)" default="6" />
<Option name="ZSTD_LEVEL" type="int" description="ZSTD compression level 1(fast)-22(slow)" default="9" />
<Option name="MAX_Z_ERROR" type="float" description="Maximum error for LERC compression" default="0" />
<Option name="WEBP_LOSSLESS" type="boolean" description="Whether lossless compression should be used" default="FALSE" />
<Option name="WEBP_LEVEL" type="int" description="WEBP quality level. Low values result in higher compression ratios" default="75" />
<Option name="NUM_THREADS" type="string" description="Number of worker threads for compression. Can be set to ALL_CPUS" default="1" />
<Option name="NBITS" type="int" description="BITS for sub-byte files (1-7), sub-uint16 (9-15), sub-uint32 (17-31), or float32 (16)" />
<Option name="INTERLEAVE" type="string-select" default="PIXEL">
<Value>BAND</Value>
<Value>PIXEL</Value>
</Option>
<Option name="TILED" type="boolean" description="Switch to tiled format" />
<Option name="TFW" type="boolean" description="Write out world file" />
<Option name="RPB" type="boolean" description="Write out .RPB (RPC) file" />
<Option name="RPCTXT" type="boolean" description="Write out _RPC.TXT file" />
<Option name="BLOCKXSIZE" type="int" description="Tile Width" />
<Option name="BLOCKYSIZE" type="int" description="Tile/Strip Height" />
<Option name="PHOTOMETRIC" type="string-select">
<Value>MINISBLACK</Value>
<Value>MINISWHITE</Value>
<Value>PALETTE</Value>
<Value>RGB</Value>
<Value>CMYK</Value>
<Value>YCBCR</Value>
<Value>CIELAB</Value>
<Value>ICCLAB</Value>
<Value>ITULAB</Value>
</Option>
<Option name="SPARSE_OK" type="boolean" description="Should empty blocks be omitted on disk?" default="FALSE" />
<Option name="ALPHA" type="string-select" description="Mark first extrasample as being alpha">
<Value>NON-PREMULTIPLIED</Value>
<Value>PREMULTIPLIED</Value>
<Value>UNSPECIFIED</Value>
<Value aliasOf="NON-PREMULTIPLIED">YES</Value>
<Value aliasOf="UNSPECIFIED">NO</Value>
</Option>
<Option name="PROFILE" type="string-select" default="GDALGeoTIFF">
<Value>GDALGeoTIFF</Value>
<Value>GeoTIFF</Value>
<Value>BASELINE</Value>
</Option>
<Option name="PIXELTYPE" type="string-select">
<Value>DEFAULT</Value>
<Value>SIGNEDBYTE</Value>
</Option>
<Option name="BIGTIFF" type="string-select" description="Force creation of BigTIFF file">
<Value>YES</Value>
<Value>NO</Value>
<Value>IF_NEEDED</Value>
<Value>IF_SAFER</Value>
</Option>
<Option name="ENDIANNESS" type="string-select" default="NATIVE" description="Force endianness of created file. For DEBUG purpose mostly">
<Value>NATIVE</Value>
<Value>INVERTED</Value>
<Value>LITTLE</Value>
<Value>BIG</Value>
</Option>
<Option name="COPY_SRC_OVERVIEWS" type="boolean" default="NO" description="Force copy of overviews of source dataset (CreateCopy())" />
<Option name="SOURCE_ICC_PROFILE" type="string" description="ICC profile" />
<Option name="SOURCE_PRIMARIES_RED" type="string" description="x,y,1.0 (xyY) red chromaticity" />
<Option name="SOURCE_PRIMARIES_GREEN" type="string" description="x,y,1.0 (xyY) green chromaticity" />
<Option name="SOURCE_PRIMARIES_BLUE" type="string" description="x,y,1.0 (xyY) blue chromaticity" />
<Option name="SOURCE_WHITEPOINT" type="string" description="x,y,1.0 (xyY) whitepoint" />
<Option name="TIFFTAG_TRANSFERFUNCTION_RED" type="string" description="Transfer function for red" />
<Option name="TIFFTAG_TRANSFERFUNCTION_GREEN" type="string" description="Transfer function for green" />
<Option name="TIFFTAG_TRANSFERFUNCTION_BLUE" type="string" description="Transfer function for blue" />
<Option name="TIFFTAG_TRANSFERRANGE_BLACK" type="string" description="Transfer range for black" />
<Option name="TIFFTAG_TRANSFERRANGE_WHITE" type="string" description="Transfer range for white" />
<Option name="STREAMABLE_OUTPUT" type="boolean" default="NO" description="Enforce a mode compatible with a streamable file" />
<Option name="GEOTIFF_KEYS_FLAVOR" type="string-select" default="STANDARD" description="Which flavor of GeoTIFF keys must be used">
<Value>STANDARD</Value>
<Value>ESRI_PE</Value>
</Option>
</CreationOptionList>
<OpenOptionList>
<Option name="NUM_THREADS" type="string" description="Number of worker threads for compression. Can be set to ALL_CPUS" default="1" />
<Option name="GEOTIFF_KEYS_FLAVOR" type="string-select" default="STANDARD" description="Which flavor of GeoTIFF keys must be used (for writing)">
<Value>STANDARD</Value>
<Value>ESRI_PE</Value>
</Option>
<Option name="GEOREF_SOURCES" type="string" description="Comma separated list made with values INTERNAL/TABFILE/WORLDFILE/PAM/NONE that describe the priority order for georeferencing" default="PAM,INTERNAL,TABFILE,WORLDFILE" />
<Option name="SPARSE_OK" type="boolean" description="Should empty blocks be omitted on disk?" default="FALSE" />
</OpenOptionList>
Other metadata items:
LIBTIFF=INTERNAL
We recently found out the compression type was wrong. WEBP instead of Geotiff. It will be resolved.

How can I validate that a radio button was selected using cfform built-in validation?

Say I have a simple cfform that looks like this:
<cfform id="fruitForm" method="post" action="">
<cfinput type="radio" name="fruit" id="fruit_apple" value="Apple" /><label for="fruit_apple">Apple</label><br />
<cfinput type="radio" name="fruit" id="fruit_orange" value="Orange" /><label for="fruit_orange">Orange</label><br />
<cfinput type="radio" name="fruit" id="fruit_pear" value="Pear" /><label for="fruit_pear">Pear</label><br />
<cfinput type="submit" name="submitFruit" id="submitFruit" value="Submit" />
</cfform>
How can I use the built-in cfform validation to ensure that at least one radio button in this group is selected? I've tried adding a validate="required" to each of the radio buttons but it doesn't work. Is there any simple way to "require" one of the buttons to be selected using cfform validation?
Do yourself a favor and don't use cfform for validation. Write your own server and client side validation, but according to the cfinput documentation if you add a required="true" attribute to each radio button ColdFusion will do the client side validation for you.
Note: The user can bypass this validation and still submit a form without checking a radio button. You need to have server side validation as well.
<cfform id="fruitForm" method="post" action="">
<cfinput type="radio" name="fruit" id="fruit_apple" value="Apple" required="true" /><label for="fruit_apple">Apple</label><br />
<cfinput type="radio" name="fruit" id="fruit_orange" value="Orange" required="true" /><label for="fruit_orange">Orange</label><br />
<cfinput type="radio" name="fruit" id="fruit_pear" value="Pear" required="true" /><label for="fruit_pear">Pear</label><br />
<cfinput type="submit" name="submitFruit" id="submitFruit" value="Submit" />
</cfform>
This works for me:
<cfform action="abc.cfm" method="post">
<cfinput type="radio" required="yes" message="pick something" name="x" value="1">radio 1
<cfinput type="radio" required="yes" message="pick something" name="x" value="">radio 2
<input type="submit" />
</cfform>
In fact, you don't even need the message attribute. It will still validate.

radio button auto check based on condition using jstl

i need to set the radio button as checked based on the value present in the request. below is the code i used in my JSP
<input type="radio" name="status" id="status" value="Active" checked="<c:if test="${posting.postingStatus eq 'Active'}">checked</c:if>">
Active
<input type="radio" name="status" id="status" value="Closed" checked="<c:if test="${posting.postingStatus eq 'Closed'}">checked</c:if>">
Closed
I am getting the radiobutton along with the text 'checked/>Active' and another radio button with text 'checked/>Closed'
i tried using another set of code
<c:choose>
<c:when test="${posting.postingStatus eq 'Active'}">
<input type="radio" name="status" id="status" value="Active" checked="checked"/>
Active
<input type="radio" name="status" id="status" value="Closed"/>
Closed
</c:when>
<c:otherwise>
<input type="radio" name="status" id="status" value="Active" />
Active
<input type="radio" name="status" id="status" value="Closed" checked="checked"/>
Closed
</c:otherwise>
i am getting double times with improper result.
can anyone help me with this?
Try this way:
<input type="radio" name="status" id="status"
value="Active" ${posting.postingStatus=='Active'?'checked':''}>

Separation of forms & also drop down menu alteration when object selected

In the image provided of my registration page, I wish to put a vertical separator inbetween the form on the left to have another form on the right to be completed for the registration but I have no idea how to do it.
http://puu.sh/1FJIA
Also the second part of my question pertains to the drop down menu, how would I put an extra option other than #_usergroups that when selected will alter the drop down menu to change into a text box? Below is the coding used for the xml.
<?xml version="1.0" encoding="UTF-8"?>
<form>
<fieldset name="default"
label="COM_USERS_REGISTRATION_DEFAULT_LABEL"
>
<field name="spacer" type="spacer" class="text"
label="COM_USERS_REGISTER_REQUIRED"
/>
<field name="name" type="text"
description="COM_USERS_REGISTER_NAME_DESC"
filter="string"
label="COM_USERS_REGISTER_NAME_LABEL"
message="COM_USERS_REGISTER_NAME_MESSAGE"
required="true"
size="30"
/>
<field name="username" type="text"
class="validate-username"
description="COM_USERS_DESIRED_USERNAME"
filter="username"
label="COM_USERS_REGISTER_USERNAME_LABEL"
message="COM_USERS_REGISTER_USERNAME_MESSAGE"
required="true"
size="30"
validate="username"
/>
<field name="password1" type="password"
autocomplete="off"
class="validate-password"
description="COM_USERS_DESIRED_PASSWORD"
field="password2"
filter="raw"
label="COM_USERS_REGISTER_PASSWORD1_LABEL"
message="COM_USERS_REGISTER_PASSWORD1_MESSAGE"
required="true"
size="30"
validate="equals"
/>
<field name="password2" type="password"
autocomplete="off"
class="validate-password"
description="COM_USERS_REGISTER_PASSWORD2_DESC"
filter="raw"
label="COM_USERS_REGISTER_PASSWORD2_LABEL"
message="COM_USERS_REGISTER_PASSWORD2_MESSAGE"
required="true"
size="30"
/>
<field name="email1" type="email"
description="COM_USERS_REGISTER_EMAIL1_DESC"
field="id"
filter="string"
label="COM_USERS_REGISTER_EMAIL1_LABEL"
message="COM_USERS_REGISTER_EMAIL1_MESSAGE"
required="true"
size="30"
unique="true"
validate="email"
/>
<field name="email2" type="email"
description="COM_USERS_REGISTER_EMAIL2_DESC"
field="email1"
filter="string"
label="COM_USERS_REGISTER_EMAIL2_LABEL"
message="COM_USERS_REGISTER_EMAIL2_MESSAGE"
required="true"
size="30"
validate="equals"
/>
<field name="title" type="sql"
default="-None Listed-"
label="Select your University"
description="Select the University you are currently attending, if
it's not on the list then create it below"
query="SELECT title FROM #__usergroups WHERE ID > '8 ' "
required="true"
/>
<field
name="captcha"
type="captcha"
label="COM_USERS_CAPTCHA_LABEL"
description="COM_USERS_CAPTCHA_DESC"
validate="captcha"
/>
</fieldset>
</form>
1. Vertical separator:
you can use a hack i.e. create some fields which will output markup.
The idea here is to insert an extra
<div style='width:50%'>
before the first field;
Then a
</div><div style='width:49%;border-left:1px dashed black'>
where you want the separator
and finally a at the end.
Create three new spacer fields.
You can either insert properly escaped html directly:
<field type="spacer" name="splitterinit" label="<div>" />
or put the html as language constants in the language file:
SPLITTER_MID="</div><div style='width:49%;border-left:1px dashed black'>"
and simply use the constant in the .xml:
<field type="spacer" name="splittermid" label="SPLITTER_MID" />
2. Extra text option:
Easy: Simply add a text field below to allow the user to type in.
Harder: Create a custom element, there you can write php and make it
as you want it
3. A word of advice
Chronoforms features a user registration override that lets you define all the fields you want, and for sure you'll find more similar extensions on the JED
Also, all community solutions feature custom profiles.

Resources