Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Development and suggestions about third part tool integration.
Cordova, Xamarin, Basic4Android topics are listed here.

Checkbox Value

More
IP: 93.34.225.185 7 years 8 months ago #13915 by mfranc28
Checkbox Value was created by mfranc28
Greetings, anyone know how can I get the value of the checkbox? I don't mean "check status" but the real value, like for example the value of a label.

I need so because I have a PDF Form with a couple of checkbox with same name but different value so when I check one of this I need to save the corrispettive value not it's check status.

Thanks
More
IP: 37.183.44.177 7 years 8 months ago #13916 by Davide
Replied by Davide on topic Checkbox Value
Hi,
can you please send us a sample pdf so we can check it?
Please give us the value you expect to get from the checkbox?
More
IP: 93.34.225.185 7 years 8 months ago #13920 by mfranc28
Replied by mfranc28 on topic Checkbox Value
Hi Davide,
my colleague have make this code under Android Native for radio for get the export value but in Xamarin don't work, probably some method are not exposed in SDK (for ex. Advance_GetRef())? I think it's same logic also for check....

public String GetRadaeeRadioValue(Document m_doc)
{
Obj obj = m_doc.Advance_GetObj(Advance_GetRef());
if (obj != null)
{
try
{
Obj item = obj.DictGetItem("AP");

if (item != null)
{
int type = item.GetType();
String type_name = get_type_name(type);

if ("dictionary".equals(type_name))
{
item = item.DictGetItem("D");

if (item != null)
{
String value = item.DictGetItemTag(0);
if (value != null && value.equals("Off"))
value = item.DictGetItemTag(1);

return value != null && value.equals("Off") ? null : value;
}
return null;
}
}

item = obj.DictGetItem("AS");
if (item != null)
{
return item.GetName();
}
}
catch (Exception ex)
{
Log.e("RadioError", ex.getMessage());
return null;
}
}
return null;
}

In attach there is a PDF example with mutual checkbox and the code above works.
Can you help me how to implement it in Xamarin?
More
IP: 37.183.44.177 7 years 8 months ago #13922 by Davide
Replied by Davide on topic Checkbox Value
Hi,
you have to expose these methods for Xamarin.
You have to implement it in native Android in the demo project and compile for Xamarin.
I suggest you to check what we do for the other methods in RadaeePDFManager class.
More
IP: 212.97.62.176 7 years 8 months ago #13923 by nermeen
Replied by nermeen on topic Checkbox Value

(for ex. Advance_GetRef())

Most probably this method is created by your colleague, to get the reference of annotation you need to call m_annot.Advance_GetRef().


You can also implement the same function in Xamarin as follows:
Code:
private String[] m_types = new String[] { "null", "boolean", "int", "real", "string", "name", "array", "dictionary", "reference", "stream" };
Code:
private String get_type_name(int type) { if (type >= 0 && type < m_types.Length) return m_types[type]; else return "unknown"; }
Code:
public String GetRadaeeRadioValue(Document m_doc) { Obj obj = m_doc.Advance_GetObj(m_annot.Advance_GetRef()); if (obj != null) { try { Obj item = obj.DictGetItem("AP"); if (item != null) { int type = item.Type; String type_name = get_type_name(type); if ("dictionary".Equals(type_name)) { item = item.DictGetItem("D"); if (item != null) { String value = item.DictGetItemTag(0); if (value != null && value.Equals("Off")) value = item.DictGetItemTag(1); return value != null && value.Equals("Off") ? null : value; } return null; } } item = obj.DictGetItem("AS"); if (item != null) { return item.Name; } } catch (Exception ex) { return null; } } return null; }
More
IP: 93.35.185.235 7 years 8 months ago - 7 years 8 months ago #13926 by mfranc28
Replied by mfranc28 on topic Checkbox Value
Thanks, I try it now.
Last edit: 7 years 8 months ago by mfranc28.
Time to create page: 0.416 seconds
Powered by Kunena Forum