void HtmlLinkButton::renderAttributes(HtmlWriter &writer) { ControlBase::renderAttributes(writer); if(hasID()) writer.writeAttribute(_S("href"), getEventCommand(EVENT_ONCLICK)); }
String HtmlTabCtrl::getPageLink(uint32 index) { OS_EXCEPT_IF(hasID() == false, "Invalid tabctrl id"); OS_EXCEPT_IF(getRequest() == nullptr, "Invalid request object"); ordered_map<std::wstring, std::wstring> params(getRequest()->getUrlParams()); params.set(getTarget().to_wide(), conversions::to_wstring(index)); return HttpParser::generateLink(getRequest()->getRawUrl(), params); }
void Element::removedFromDocument() { if (hasID()) { if (NamedAttrMap* attrs = namedAttrMap.get()) { Attribute* idItem = attrs->getAttributeItem(idAttr); if (idItem && !idItem->isNull()) updateId(idItem->value(), nullAtom); } } ContainerNode::removedFromDocument(); }
void Element::insertedIntoDocument() { // need to do superclass processing first so inDocument() is true // by the time we reach updateId ContainerNode::insertedIntoDocument(); if (hasID()) { if (NamedAttrMap* attrs = namedAttrMap.get()) { Attribute* idItem = attrs->getAttributeItem(idAttr); if (idItem && !idItem->isNull()) updateId(nullAtom, idItem->value()); } } }
void IHtmlSelect::renderAttributes(HtmlWriter &writer) { ControlBase::renderAttributes(writer); if(hasID()) { writer.writeAttribute(_S("id"), getTarget()); writer.writeAttribute(_S("name"), getTarget()); } if(getEventChange()->empty() == false) writer.writeAttribute(_S("onchange"), getEventCommand(EVENT_ONCHANGE)); else if(getAutoPostBack()) writer.writeAttribute(_S("onchange"), _S("javascript:return osAutoPostBack(this);")); }
bool Element::supportsStyleSharing() const { if (!isStyledElement() || !parentElement()) return false; // If the element has inline style it is probably unique. if (inlineStyle()) return false; // Ids stop style sharing if they show up in the stylesheets. if (hasID() && affectedByIdSelector(idForStyleResolution())) return false; // :active and :hover elements always make a chain towards the document node // and no siblings or cousins will have the same state. if (isUserActionElement()) return false; return true; }
void IHtmlSelect::onInit() { ControlBase::onInit(); // 01/12/2009 0.13-RC2 /* if(getPostBack() && hasID()) // Inizializza il valore del controllo setValue(getRequest()->getPostParamString(getTarget().to_ascii())); */ if(getPostBack() && hasID()) { // Ottiene il parametro associato al controllo shared_ptr<HttpPostParam> param = getRequest()->getPostParam(getTarget().to_wide()); // Verifica che sia stato postato un parametro relativo al controllo if(param != nullptr) // Inizializza il valore del controllo setValue(param->getString()); } }
int32 HtmlTabCtrl::getCurSel() const { return hasID() ? conversions::from_wstring<int32>(getRequest()->getUrlParam(getTarget().to_wide())) : -1; }